Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

 

Table of Contents

CommCare has several geospatial features that allow for calculating distances between geographic coordinates, sorting case lists by distance from you, and displaying case location data in a map view. 

Collecting location data with CommCare

Adjusting accuracy and timeout of GPS capture

As of CommCare 2.33, advanced users can adjust the accuracy and timeouts for GPS capture question widget and GPS auto-capture.

This is done by enabling the "Allow users to add arbitrary custom properties to their application" feature flag and adding any of the following property key/values:

  • cc-gps-auto-capture-accuracy: Auto-capture accuracy in meters
  • cc-gps-auto-capture-timeout: Elapse time (in minutes) before GPS auto-capture gives up on acquiring an accurate location. 
  • cc-gps-widget-good-accuracy: The accuracy value in meters needed for the question widget to store the location and auto-close
  • cc-gps-widget-acceptable-accuracy: The accuracy value in meters needed for the question widget to start recording location values
  • cc-gps-widget-timeout-secs: The elapse time, in seconds, needed before the question widget will start recording location values regardless of accuracy. (not sure exactly why we have this)

...


Distance calculations in CommCare

As of CommCare 2.26, the distance between two geographic coordinates (latitude and longitude pairs) can be calculated using the distance() function. This function takes in two geopoints and returns the distance, in meters between them, taking into account the curvature of the earth's surface.

...