react-native-background-geolocation
react-native-background-geolocation copied to clipboard
Filter outliers based on distance
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.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.