Survey123 coordinate transformation?

1046
5
12-19-2019 07:28 AM
ChandlerCallison
New Contributor III

I've created a survey to keep track of hydrant painting in our district. The survey is opened through a link in a Collector popup. There are lat/long values on each hydrant that are passed to the survey through the custom URL so that the survey record shows up exactly on top of the hydrant point. The problem is, the survey record shows up about 3 feet from the hydrant, even though the lat/long values are the same. I imagine this is due to differences in coordinate system between Survey123 and the hydrants. The lat/longs on the hydrants were calculated in Desktop in NAD 1983 State Plane coordinate system. What do I need to do to get the survey results to show up in the correct location?

5 Replies
DougBrowning
MVP Esteemed Contributor

123 is always WGS84 I think since your tablet is WGS84.  I have the same issue.  What I do is just make a lat/long static field and calc it in.  I do this because we want to know if anyone moves it.  You may be able to change 123 to use a diff map but I think anytime you as what is my GPS it will always be 84.

But I also have the code for Arcade to create them dynamically.   That way if a point ever moves it auto changes the lat/long.

var originShift = 2.0 * PI * 6378137.0 / 2.0;
var lon = (Geometry($feature).x / originShift) * 180.0;
var lat = (Geometry($feature).y / originShift) * 180.0;

lat = 180.0 / PI * (2.0 * Atan( Exp( lat * PI / 180.0)) - PI / 2.0);

return lon + "  " + lat;
Kara_Lara
New Contributor III

Where do you enter this code @DougBrowning ?

0 Kudos
DougBrowning
MVP Esteemed Contributor

This is Arcade for the popup in Field Maps that then gets passed to the 123 form.

0 Kudos
CarynAshbay
New Contributor III

Hi Chandler,

I'm also working on achieving the same goal. I'm attempting to ensure that my Survey123 results align precisely with a known point. Have you managed to get this working?

 

0 Kudos
DougBrowning
MVP Esteemed Contributor

You can use the above code in the popup in Field Maps if you use it to yell at them in Red they are too far.

If after the fact in the web map you can use FeatuerSet in Arcade to get the 2 points and compare distance.  But really why not stop them in the first place which is what I do below.

We also pass the lat/long of where they were supposed to go over to 123 and compare that to where they are.  Then report to them how far they are from where they were supposed it be.  We also put red warnings on this.  We could also do a constraint so they cannot even collect but we had issues where sometimes the GPS fails in steep canyons so we did not want to stop them completely from collecting.

DougBrowning_0-1712092471376.png

The formula is the same but here is how to write it in 123.  Here the Design lat and long get passed into the form from Field Maps and the form compares this to the users current lat/long.

round(acos(sin(${LatitudeWGS84} * pi() div 180)*sin(${DesignLatitudeWGS84} * pi() div 180) + cos(${LatitudeWGS84} * pi() div 180)*cos(${DesignLatitudeWGS84} * pi() div 180)*cos((${DesignLongitudeWGS84} * pi() div 180)-(${LongitudeWGS84} * pi() div 180))) * 6371000,2)

This should do exactly what you want and it works slick.

0 Kudos