Validate GPS location against pre-defined location


This sample demonstrates a way to validate the surveyor's location against a predefined location of the selected city. 

The general logic is this:

- The surveyor choose a city from a displayed list

- If no valid GPS location is captured, the interview cannot be continued.

- Once there is a valid GPS location, the code compare between the captured location and the pre-defined location of the selected city, and display an error message if the current surveyor's location is more than 20 meters from the pre-defined city location. At this state the interview cannot be continued, until the surveyor will change his location to be 20 meters or less than the pre-defined city location.

- The valid distance can of course be changed to any value needed.


To import the attached SRV file, follow this link: How-to-import-a-survey


The pre-defined cities and locations can be found in the attached excel file. This file need to be imported to the studio as additional data list and be attached to the survey. Please follow this link to learn more about additional data lists and subject stores: How-to-use-an-excel-file-as-a-data-list-in-a-survey 


That's it!

Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request



Please sign in to leave a comment.