react-native-background-geolocation icon indicating copy to clipboard operation
react-native-background-geolocation copied to clipboard

Filter outliers based on distance

Open Stophface opened this issue 1 year ago • 1 comments

Your Environment

  • Plugin version: 4.12.0
  • Platform: iOS
  • OS version: 17
  • React Native version (react-native -v): 0.73.0
  • Plugin config
  desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_MEDIUM
  stationaryRadius: 25,
  desiredOdometerAccuracy: 10,
  disableElasticity: true,
  disableLocationAuthorizationAlert: true,
  maxRecordsToPersist: 1,
  stopOnTerminate: false,
  stopTimeout: 5,
  disableMotionActivityUpdates: true,
  debug: false,
  startOnBoot: false,
  forceReloadOnBoot: false,
  logLevel: BackgroundGeolocation.LOG_LEVEL_OFF,
  showsBackgroundLocationIndicator: true,
  allowIdenticalLocations: false,
  foregroundService: true,
  locationAuthorizationRequest: 'WhenInUse',

Expected Behavior

I am trying to filter out outliers which occur when the device is moving fast and has bad (GPS) reception (i.e. in a train). After using it for a while, there are often points which are unreasonable off. I think the only way to do this is measuring the distance of the new location and the previous location. If the distance exceeds a certain threshold, I mark it as an outlier. However, this is a bit tricky when disableElasticity is set to false, because I cannot assume a constant distance between new location and previous location to detect an outlier, since the interval of the emitted locations change with the speed: The higher, the bigger the distances between the emitted locations are and vice versa. That is why I wonder if there is any way to get the value of distanceFilter the plug in calculates or the formula the plug in uses to calculate distanceFilter based on speed (so that I can calculate a value based on the speed myself)? The documentation mentions this:

distanceFilter is auto-scaled by rounding speed to the nearest 5 m/s and adding distanceFilter meters for each 5 m/s increment.

But I do not understand it.

Stophface avatar Apr 06 '24 06:04 Stophface

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] avatar May 07 '24 01:05 github-actions[bot]

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] avatar May 22 '24 01:05 github-actions[bot]