Ensure that surveyors are within a certain radius of a given point

Let's say I have GPS coordinates of a location and the surveyors need to go there to collect the data. I would like to set up a control so that the data is collected over a radius of 7 km for example. To do the control I have to use the existing GPS coordinates and the collected one. If the difference is 7 km a message appears to inform the surveyor that he has surveyed outside the desired radius.
Has anyone ever done this kind of control. If so, can they help me by sharing a copy of the coding.
Thank

2 Likes

I started typing up how to construct a geotrace string from your reference point and collected point and use the distance function to calculate what you need while thinking 'I bet @Xiphware has a better solution' and did a quick search...it's the same solution, but saves me the trouble of recreating it :wink:

There's an example form in that thread, you would just need to replace one of the points with your reference location as a string in the concat/variable in the concat, then check that the output is <7000m

Here's the docs on the distance function:
https://docs.getodk.org/form-operators-functions/?highlight=area#distance

5 Likes

Sorry for the late reply. I read the discussions I will try the coding.
thanks

1 Like

Hi @Nasser,

If you are familiar with geospatial shapefiles, you may also want to consider using the approach to geofencing that I described in a recent post...

1 Like