To collect GPS data automatically with a form submission, see Automatic GPS Capture https://dimagi.atlassian.net/wiki/x/ZynKfw. For troubleshooting, see GPS Limitations.
Deciphering the Data
GPS data in CommCare is captured in decimal degrees. It has 4 components, separated by a space character:
Latitude: in decimal degrees
Longitude: in decimal degrees
Elevation: in metres, and
Precision / Accuracy: in metres
For example, a data point collected in CommCare and viewed through form data may look something like 25.615311244889146 85.08323017699811 28.44 20.0, where:
25.615311244889146 specifies the latitude in decimal degrees
85.08323017699811 specifies the longitude in decimal degrees
28.44 specifies the elevation in metres, and
20.0 specifies the precision in metres.
Mapping the Data
GPS data in CommCare is captured in decimal degrees. It is easy to make a map using Google Earth.
Google Earth requires a kml file. You can generate a kml file using an Excel file and a free converter like this one.
Export data from CommCareHQ into Excel
If all of the coordinates are in one cell, select the GPS coordinates field and use the Excel "text to columns" feature to separate the GPS field into its 4 component fields (latitude, longitude, elevation, precision). You can delete the elevation and precision columns for a basic map.
...
if(/data/location1 = '', '', if(/data/location2 = '', '', distance(/data/location1, /data/location2)))
Limitations to GPS
GPS positions provided via android devices are generated using multiple different methods, resulting in highly variable performance. Performance depends on the device, the cell network, availability of GPS satellites and line of sight to these satellites (http://en.wikipedia.org/wiki/GPS_signals ).
GPS devices need 3 pieces of data in order to find the current coordinates:
Almanac data: very coarse satellite position information, good for 4 months and taking 12.5 minutes to download from a satellite; updated every 6 days
Ephemeris data: fine-grained satellite position information, good for 4 hours and taking 18-36 seconds to download from a satellite; updated every 2 hours
A lock on 3+ satellites
A cold start happens when the device was off for more than 4 hours and new ephemeris data needs to be downloaded. A warm start happens when the ephemeris data is still valid and the device simply needs to get a lock on satellites. A device is "hot" if it has that lock. To accelerate the "time to first fix" (time from turning on the device to getting coordinates), a variety of techniques get used: (http://en.wikipedia.org/wiki/Assisted_GPS )
A-GPS or assisted GPS
The phone downloads ephemeris data from the cell tower (MSB)
The phone sends its captured GPS data to the cell tower, letting the tower perform the calculations (MSA)
The phone uses cell tower triangulation, totally ignoring the phone's GPS functionality - accuracy is usually reported as being more than 1000m.
Some phones have incomplete GPS hardware, requiring a cell network to function - they depend on MSA as described above. The quality of the GPS antenna will affect how quickly a device will get a lock; so will trees, tall buildings or being inside concrete structures. Stand-alone devices usually have better GPS hardware and antennas.
Finally, new devices often support GLONASS in addition to GPS. GLONASS is a Russian network very similar to GPS. When combined, devices that support GLONASS and GPS will have very rapid satellite locks and high accuracy. GLONASS particularly excels in high latitudes (very south or very north of the equator).
Speed and accuracy of getting a GPS lock is highly variable. For example, the S10 has relatively good GPS hardware, including GLONASS and A-GPS support. However, it will still have issues when surrounded by concrete and getting a satellite lock will take longer when outside of cell network data coverage. It's not possible to "boost" the signal. However, you can ensure that your GPS unit is at the very least always "warm" and thereby reduce the acquisition time. For example, running something like Google's "MyTracks" app set to record the GPS location every 15 or 30 minutes should minimally impact the battery life but keep GPS should remain warm (Simply running MyTracks in the background is enough, it is not necessary to have it open all the time).