Dynamic select-one-external based on start-geopoint

1. What is the problem? Be very detailed.
Not a problem (yet) but I need advice on the functionality of start-geopoint:
It seems like I can use start-geopoint as the “landing spot” when I launch maps.me from within ODK Collect, see the attached form. This is based on LN’s ‘wayfinding’ example – I don’t understand how the calculation works but it does open maps.me where I open the form and not at the default coordinates I have set for Australia (which I made as the other side of the country).
But, I can’t get this to work without the need for the choice of a country first (since the calculations require the instance that was selected there). Ideally, I would like to launch maps.me without this need for a country choice first (ie: based purely on the value of start-geopoint). It is certainly not a problem if I do need this extra step.
Further to this:
Can I use an Accuracy Threshold in combination with start-geopoint to dynamically populate a select_one from an external list of nearly 3000 fieldsites across multiple countries? Eg: set an Accuracy Threshold of, say, 100m from the start-geopoint and have a dynamic select-one that gets populated only by the known Localities that are within that range. This means that, with a single click after scanning a manageable list, the user can select the ‘correct’ Locality Name for the survey.
Background: our group does ecological (biocontrol) surveys throughout Australia and Asia. In over 30 years of research we have nearly 3000 field sites in more than 10 countries. My goal is to convert our data collection from paper to digital by linking Collect to my tailored database (currently MS Access) via Google Sheets. The current database gives an autonumber for each Locality, it is that number (not the Locality Name) that needs to be added to the form so that it will semi-automatically create a new survey record in the database. Often we have clusters of Localities because we work on different weeds (aquatic plants, trees, ferns) – we want to keep precise GPS coordinates to make it easy for the collector to find the plant at a locality they may not have visited in months/years.
I have tried using cascading selects to filter the options down to a manageable choice (Country – State – District - Locality) but sometimes we don’t necessarily know what ‘District’ we are in so the “correct” Locality name (it needs to be an exact code so that the correct autonumber gets populated into the db’s Locality field) may not even appear on the filtered list. Also, it is at least 4 selections in the form when ideally it can be just one.
Also, I thought that some type of calculation could read the start-geopoint Lat and Long numbers and return all current Localities that match the first 5 or 6 digits eg: start-geopoint is -27.12345 142.12345 so the select-one gets populated with all options that match -27.12 AND match 142.12. But, this may lose Localities when you are on the cusp of a meridian (if that’s the right word).
Then, I thought I could launch maps.me, see all the Localities in the vicinity to find the exact code of the one I want and then go back to Collect and type it in. That works but there is no way to copy the Locality name in maps.me and paste it in Collect. Ideally, I want to eliminate that back and forth. AND, I love the elegance of the form doing all the hard work for me.
So, can start-geopoint be used to populate a select-one-external?
And, what are the simplest options if I can’t wrangle start-geopoint to do it for me?

2. What app or server are you using and on what device and operating system? Include version numbers.
Currently using Collect on various android phones and Galaxy tablets. I use Briefcase to pull and export but have also developed the Google Sheets version. It needs some tweaks before I roll it out to the team. I then populate an Excel file with all fields relevant to the correct table in the database (Google Sheets will do that automatically for me once I work it out) and import the new records into the database.
Hence, ODK-X is my next port of call. Tweaking the geotagger demo seems the ideal way to choose the ‘correct’ Locality and/or create a new locality from which to launch into the full range of data recording we do in the field.

3. What you have you tried to fix the problem?
I tried a few variations of my current form (based on LN’s ‘wayfinding’ example) replacing the ex:com.mapswithme…. path with something referencing start-geopoint and then with references to start-geopoint-Latitude and start-geopoint-Longitude. But, each time maps.me crashed except for the current version attached.
I haven’t tried working with dynamic select – these things take me a long time to work out due to my lack of computer knowledge.
I would love to know whether it is possible – then I am happy to commit the time to trying it and to provide a way for others to manipulate this function for their own needs.

4. What steps can we take to reproduce the problem?

5. Anything else we should know or have? If you have a test form or screenshots or logs, attach below.
See attached, sorry for the long message (you did say “Be very detailed”)
start-wayfinding.xlsx (12.2 KB)

Update: now that I am home I can see that the current version doesn't work as expected. It will open maps.me but only at the last spot that it was opened - not what I wanted.

I did come up with a solution to this problem - just forgot to update this request. Didn't need an external select either.
In Choices tab with 2500+ localities across multiple countries i created choice-filter columns for lat and for long, which rounded each location's exact coordinates down to 2 decimal places.
In Survey tab i created calculations: selected-at(${start-geopoint},0) and; selected-at(${start-geopoint},1) and used those values to launch maps.me at the location the form was generated. I then added calculations to round the start-geopoint down to 2 decimal places and, using the choice_filter column, reduced the select_one options from all 2500+ to only those that share the exact same rounded values. i also added an option to create a New Locality.
This eliminated the need for a cascading select to filter from Country to State to District etc.
If anybody thinks their form/s may benefit from tailoring a version of this to their own needs i have added the relevant info in the attached Excel file - reducing the number of localities to show the variability without too much detail.
Hope it helpsgeopoint-rounding.xlsx (83.2 KB)

1 Like