XY Collected and Passed Based on Point or Feature Selection in Collector?

2370
8
08-16-2017 04:36 AM
LarryGaudieri1
New Contributor III

Is it possible to center on the point selected in Collector without having to have (on paper, list, or otherwise) the XY's known? For example, if I select a point in collector and the pop-up opens with the URL link to Survey123, is it possible that the point's selected XY values are automatically passed to Survey123 to center and zoom to the selected location?

Tags (1)
0 Kudos
8 Replies
JohnathanHasthorpe
Esri Regular Contributor

Yes this is possible using custom urls.

You can pass in a coordinate parameter (i.e. a latitude-longitude pair in decimal degrees separated by a comma: center=43.567,-117.380) as part of your custom url, and use this to set the location of the geopoint question in your survey.

See the following example:

 

arcgis-survey123://?itemID=89bc8c7844e548e09ba3aad4695e78b&field:AssetID=FF34001&field:Status=Good&center=43.567,-117.380

To get this working you would need to create a field in your feature service that contains the latitude-longitude pair in the correct format. Then you could pass the value in as a variable:

arcgis-survey123://?itemID=89bc8c7844e548e09baa3aad4695e78b&field:AssetID=FF34001&field:Status=Good&center={CoordField}

For more information on custom urls, please see the following:

https://community.esri.com/groups/survey123/blog/2016/07/30/understanding-survey123s-custom-url-sche... 

Cheers

John

LarryGaudieri1
New Contributor III

Johnathan,

Thanks for your reply (Mike, thank you but we're not using receivers). I've read the 'Understanding Survey123's custom URL Scheme' before posting and I understand '&center={CoordField}' but the question remains for me is how do I calculate the lat & long values to a feature service? I used the field calculator online and it was pre-populated with the ability for X and Y but the results look more like SPC for my zone.

I haven't done anything special to enable a projection (except that maybe the original data was published from one) so, I'm still a little stuck. I'd like not to have to republish this service so can anyone speak to this? Thanks in advance.

0 Kudos
by Anonymous User
Not applicable

What is the original coordinate system of the previously located locations that you are using within this task?

State Plane or Lat/Long?

0 Kudos
LarryGaudieri1
New Contributor III

Hey Mike, yeah....the points originated in SPC....trying to not have to bring the service down, reproject and republish....any JSON that can put them in geographic?

0 Kudos
by Anonymous User
Not applicable

That's a good question and one that I am interested within also.

0 Kudos
JamesTedrick
Esri Esteemed Contributor

Hi Larry, Mike,

It should be possible.  The search query has an output  spatial reference property; this how a State Plane feature service can appear nicely on top of the ArcGIS Basemaps (either Web Mercator or WGS1984).  Take a look at Query: Wildfire Response Points (ID: 0)  (The layer is natively stored in Web Mercator).  A script could go through grab the X & Y, and update the feature with the values (assuming Latitude/Longitude fields).  

This is also an area that Arcade (the new scripting language) will be able to help with in the future - Geometry Functions | ArcGIS for Developers .  You can create a calculate field with the X & Y values; currently this produces them in the web map's coordinate system; using a WGS1984 basemap would give lat & long.  

0 Kudos
LarryGaudieri1
New Contributor III

Thank you Jim! Looking into your solution. Appreciate the help.

0 Kudos
by Anonymous User
Not applicable

There is also another way of completing this task and it utilizes the above method, but would also involve using the High Accuracy Data collection method within Collector. Have a look at this posting as it could help you in multiple ways; your X,Y and the GPS metadata.

https://community.esri.com/groups/survey123/blog/2017/05/31/blog-high-accuracy-gps-data-collection-o...