Hi !
is there a way to pass the location of a line in collector "Aurora" to Survey123 in the same way of passing the location to a geopoint in survey123 ?
Thanks to great thread https://community.esri.com/groups/survey123/blog/2016/07/30/understanding-survey123s-custom-url-scheme from https://community.esri.com/people/ichivite-esristaff and https://community.esri.com/people/JTedrick-esristaff
Hi Marc-Andre,
I had a bit of time to work this out - this should provide the line. There are some issues with more complex lines, as they can consist of multiple parts:
var geom = Geometry($feature); var outparts = []; var counter = 0; for (var p in geom.paths) { var thispath = geom.paths ; for (var pt in thispath) { var ptstr = Concatenate(thispath[pt].y, " ", thispath[pt].x); outparts[counter]= ptstr; counter = counter + 1; } } return Concatenate(outparts, ";");
What aspect of the line do you want to bring into Survey123? I would take a look at the Geometry functions in Arcade Function Reference | ArcGIS for Developers - you could include these as an attribute expression.
Hi James,
thanks for your quick response.
I would like to "copy" the geometry from collector to the geotrace in Survey123.
I have a map containing roads and I want to start a survey on a specific segment.
So from collector, I pass via arguments certain fields that I want from Collector to Survey via the survey123s-custom-url-scheme. E.g.: Road name, owner,...
We currently have multiple maps and surveys that use custom url scheme with "point" entities. So the XY coordinates are pass to the survey in the geopoint.
So, I would like to do the same thing but with a line in collector to a geotrace in survey123.
Is it currently possible and supported ?
Regards,
Copying the full geometry is a little more complicated- to begin with geotrace support is in beta in Survey123. Survey123 will want the incoming coordinates to
y1 x1;y2 x2;y3 x3;...
So you would need an Arcade function to process the shape vertices into this format.
Thanks James
What would be the syntax if we want to pass a polygon geometry from Collector to a Geoshape question in Survey123?
Cheers
Chris
Hi Chris,
The Arcade expressions very similar, mostly you need to substitute 'rings' for 'paths':
var geom = Geometry($feature);var firstpart = geom.rings[0];var outparts = [];var counter = 0;for (var pt in firstpart){ var ptstr = Concatenate(firstpart[pt].y, " ", firstpart[pt].x); outparts[counter]= ptstr; counter = counter + 1; }
return Concatenate(outparts, ";")
I'm planning on publishing these in GitHub - Esri/arcade-expressions: ArcGIS Arcade expression templates for all supported profiles in the ArcGIS platform. in the near future.
I got that working, can I assume though that we would need to convert this into Lats and Longs in order to parse it through to a geoshape question?
I have built this link and although it opens up the appropriate survey and does contain the coordinates, is doesn't create the geoshape.
I have also tried substituting center for geoshape and the geoshape question name
arcgis-survey123://?itemID=6ffa91c679cd4ec99a6482e70dd3158e¢er=-4368437.09908237%2015568468.47895944%3B-4368478.018118211%2015569744.148226732%3B-4368584.9584379345%2015569765.78726955%3B-4369031.402026243%2015569856.124205573%3B-4369455.085184722%2015569941.862870062%3B-4369426.875276136%2015568806.965103844%3B-4368476.830919922%2015568477.717157682%3B-4368437.09908237%2015568468.47895944
Just to add, I have managed to get the script to convert to lat and longs, but its still not creating a geoshape in Survey123. Is the something else in the url OR the form that needs to be done in order to construct the shape?
arcgis-survey123://?itemID=6ffa91c679cd4ec99a6482e70dd3158e¢er=-34.926006640680235%20138.59669421630525%3B-34.92639395082917%20138.59672384658316%3B-34.926403392567615%20138.59653796524657%3B-34.92640749222722%20138.59645756316633%3B-34.92642486038284%20138.59611928621797%3B-34.926311593671414%20138.5961108695519%3B-34.92627059577672%20138.5961077648081%3B-34.92603749657436%20138.59608996445877%3B-34.926006640680235%20138.59669421630525
- Yes, the coordinates need to be latitude and longitude (decimal degrees, expected SRID is WGS1984 (4326) ). This is most easily accomplished by creating your web map with a 4326-based basemap (Esri provides several to comply with organizations that have mandatory requirements to use WGS1984).
- You should not use the center parameter (which conceptually, would not make sense to pass a non-point object); use field:<fieldname>.
As an example, take a look at https://www.arcgis.com/home/item.html?id=9197d8545a214fe9829e95aa095302ec
Perfect !
Arcade expression combined with a WGS84 basemap really did the trick !!!
Thank you James
Hey! I've been trying to figure this out, but it seems I don't have permission to view your survey - does the shape text translate to a shape on a map within the Survey123 form, or is it simply saved as text?
Was this ever solved? Im trying to pass the coordinates for a polygon via url but no luck on getting it to show up on the map within the survey.
?field:<geoshape field name>=47.31507205963135%20-122.41456244885921;47.314385414123535%20-122.41456244885921
This works for me. Below is the Arcade script I created:
@JamesTedrick - I would love your feedback on the reverse of this question I just posted here: https://community.esri.com/t5/arcgis-survey123-questions/javascript-snippet-to-get-a-vertex-from-a-geotrace/m-p/1408192
サインインしたメンバーは投稿、更新のフォローなどができます。初めてですか?無料アカウントを登録してください。
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.