Comparing GPS coordinates in Survey123

1007
7
Jump to solution
10-30-2021 12:21 PM
newwollyka
New Contributor III

Is there a way in Survey123 to compare the spatial distance in meters between 2 GPS coordinates (on fixed GPS coordinates and the other one is the actual location of the device/enumerator)?

If the distance is, say, more than 30m, show an error message "You are far away, please go to the designated location"?

0 Kudos
1 Solution

Accepted Solutions
DougBrowning
MVP Esteemed Contributor

Here I send in the DesignLat/Long and compare to the current (which someone called easting/northing and it drives me nuts).  Can compare any 2 with it.  

round(acos(sin(${Northing} * pi() div 180)*sin(${DesignLat} * pi() div 180) + cos(${Northing} * pi() div 180)*cos(${DesignLat} * pi() div 180)*cos((${DesignLong} * pi() div 180)-(${Easting} * pi() div 180))) * 6371000,2)

meters

View solution in original post

7 Replies
DougBrowning
MVP Esteemed Contributor

Here I send in the DesignLat/Long and compare to the current (which someone called easting/northing and it drives me nuts).  Can compare any 2 with it.  

round(acos(sin(${Northing} * pi() div 180)*sin(${DesignLat} * pi() div 180) + cos(${Northing} * pi() div 180)*cos(${DesignLat} * pi() div 180)*cos((${DesignLong} * pi() div 180)-(${Easting} * pi() div 180))) * 6371000,2)

meters

newwollyka
New Contributor III

Thanks

Does it work if one of those GPS coordinates (DesignLat/Long) are taken from Collector app through a custom URL scheme using the &center or Survey123 will be lost here?

0 Kudos
DougBrowning
MVP Esteemed Contributor

I send these using a URL.  Just send it into a field in the form then compare.

0 Kudos
newwollyka
New Contributor III

Doesn't the center (&center=43.567,-117.380) in the custom URL sets ALL the geopoint questions to those coordinates? In that case, should I sent those coordinates from the Collector app to a text field in Survey123 and then compare?

0 Kudos
DougBrowning
MVP Esteemed Contributor

Yes do not use center just send them as text into a field in the form.  Then have a second set of lat/long using pulldata to get the form GPS lat/long.  Then compare those 2 fields.  Sorry that was not clear.

newwollyka
New Contributor III

Thanks for the explanation. On a side note, can we collect the GPS automatically (hidden way) without showing or clicking on the GPS button or map in the form (using the field app)? 

0 Kudos
DougBrowning
MVP Esteemed Contributor

I think you can hide the GPS question using the new body::esri:visible column.

0 Kudos