Open shubhlumber opened 3 weeks ago
The plug-in is only the mailman, delivering to you locations provided by the native location api.
One location has an accuracy of 68.46m
(probably provided by wifi) while the other was 4.58m
(probably from gps).
If you donβt like the location.coords.accuracy
of some particular location, throw it away.
Since we are using the library's URL method, which automatically sends the coordinates to our API database, how can we filter out locations based on location.coords.accuracy for specific coordinates?
how can we filter out locations based on location.coords.accuracy for specific coordinates?
At your server, you should analyze incoming data and throw out undesirable locations.
Currently, we are sending the following locationTemplate to our database:
{"latitude":<%= latitude %>,"longitude":<%= longitude %>,"time":"<%= timestamp %>"}
This includes only latitude, longitude, and time. Is there a way to also fetch location.coords.accuracy so that we can save it in our database and use it for filtering?
See the API docs Config.locationTemplate to learn about how which attributes are available to you in your template.
Your Environment
react-native -v
):0.73.6Plugin config
Expected Behavior
Getting Correct Locations Point
Actual Behavior
At 2024-10-18 06:56:26.885, the library generated this location: π<+40.94316423, -111.89047783> +/- 68.46m (speed -1.00 m/s, course -1.00) @ 10/18/24, 6:51:36 AM MDT
Then, at 2024-10-18 06:56:40.789, the library generated this location: π<+40.98457200, -111.89573687> +/- 4.58m (speed 0.00 m/s, course -1.00) @ 10/18/24, 6:56:40 AM MDT
These two points are about 3.3 miles apart, which seems impossible within this short time frame. Could you help us understand why such a large location shift is occurring?
Steps to Reproduce
1. 2. 3. 4.
Context
Debug logs
Logs
``` 2024-10-18 06:56:23.269 ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β -[TSLocationManager stop] ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 2024-10-18 06:56:23.269 βΉοΈ-[TSLocationManager clearLastOdometerLocation] 2024-10-18 06:56:23.269 π΄-[TSGeofenceManager stop] 2024-10-18 06:56:23.269 π΄-[TSGeofenceManager stopMonitoringSignificantLocationChanges] 2024-10-18 06:56:23.269 π΄-[TSGeofenceManager stopUpdatingLocation] 2024-10-18 06:56:23.269 π΄-[TSGeofenceManager stopMonitoringGeofences] 2024-10-18 06:56:23.271 π΄-[PolygonGeofencingService stop] 2024-10-18 06:56:23.272 βΉοΈ-[PolygonGeofencingService persistMonitoredPolygons] { } 2024-10-18 06:56:23.272 π΄-[TSLocationManager stopUpdatingLocation] 2024-10-18 06:56:23.273 βΉοΈ-[TSDBLogger db_save] Log committed 2024-10-18 06:56:23.298 π΄-[TSLocationManager stopMonitoringBackgroundFetch] BackgroundFetch: OFF 2024-10-18 06:56:23.298 π΄-[TSLocationManager stopMonitoringSignificantLocationChanges] 2024-10-18 06:56:23.298 βΉοΈ-[TSLocationManager log:message:] [RNBackgroundGeolocation startObserving] 2024-10-18 06:56:23.298 βΉοΈ-[TSLocationManager on:success:failure:] location 2024-10-18 06:56:23.298 βΉοΈ-[TSLocationManager on:success:failure:] motionchange 2024-10-18 06:56:23.298 βΉοΈ-[TSLocationManager on:success:failure:] activitychange 2024-10-18 06:56:23.298 βΉοΈ-[TSLocationManager on:success:failure:] heartbeat 2024-10-18 06:56:23.298 βΉοΈ-[TSGeofenceManager onGeofence:] 2024-10-18 06:56:23.298 βΉοΈ-[TSGeofenceManager onGeofencesChange:] 2024-10-18 06:56:23.298 βΉοΈ-[TSLocationManager on:success:failure:] http 2024-10-18 06:56:23.298 βΉοΈ-[TSLocationManager on:success:failure:] providerchange 2024-10-18 06:56:23.298 βΉοΈ-[TSLocationManager on:success:failure:] schedule 2024-10-18 06:56:23.298 βΉοΈ-[TSLocationManager on:success:failure:] powersavechange 2024-10-18 06:56:23.298 βΉοΈ-[TSHttpService onConnectivityChange:] 2024-10-18 06:56:23.298 βΉοΈ-[TSLocationManager on:success:failure:] enabledchange 2024-10-18 06:56:23.298 βΉοΈ-[TSHttpService onAuthorization:] 2024-10-18 06:56:23.305 βΉοΈ-[TSConfig persist] 2024-10-18 06:56:23.307 βΉοΈ-[TSConfig persist] 2024-10-18 06:56:23.308 βΉοΈ-[TSConfig persist] 2024-10-18 06:56:23.308 βΉοΈ-[TSConfig persist] 2024-10-18 06:56:23.309 β -[LocationDAO unlock]_block_invoke UNLOCKED ALL RECORDS 2024-10-18 06:56:23.309 βΉοΈ-[LocationDAO shrink:]_block_invoke maxRecordsToPersist: 1 2024-10-18 06:56:23.309 βΉοΈ-[TSConfig persist] 2024-10-18 06:56:23.309 βΉοΈ-[TSConfig persist] 2024-10-18 06:56:23.310 π΅-[TSLocationManager ready] 2024-10-18 06:56:23.933 βΉοΈ-[TSLog destroy] SUCCESS 2024-10-18 06:56:26.864 ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β -[TSLocationManager start] ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 2024-10-18 06:56:26.864 βΉοΈ-[TSLocationManager doStart:] trackingMode: 1 2024-10-18 06:56:26.864 βΉοΈ-[TSConfig persist] 2024-10-18 06:56:26.866 πΎ-[TSGeofenceManager start] 2024-10-18 06:56:26.867 πΎ-[SOMotionDetector startDetection] 2024-10-18 06:56:26.867 π΅-[TSLocationManager setPace:] 0 2024-10-18 06:56:26.871 πΎ-[TSLocationManager startUpdatingLocation] Location-services: ON 2024-10-18 06:56:26.883 β -[SOMotionDetector startDetection]_block_invoke Enabled M7 MotionActivity updates 2024-10-18 06:56:26.883 βΉοΈ+[LocationAuthorization run:onCancel:] status: 3 2024-10-18 06:56:26.884 πΎ-[TSLocationManager startMonitoringBackgroundFetch] BackgroundFetch: ON 2024-10-18 06:56:26.885 π<+40.94316423,-111.89047783> +/- 68.46m (speed -1.00 mps / course -1.00) @ 10/18/24, 6:51:36β―AM Mountain Daylight Time 2024-10-18 06:56:26.885 ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 0 | df: -1.0m | age: 290403 ms ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 2024-10-18 06:56:26.885 βΉοΈ-[TSLocationManager locationManager:didUpdateLocations:] Received stale motionchange location. Retrying... 2024-10-18 06:56:26.890 βΉοΈ-[TSLocationManager startMonitoringBackgroundFetch]_block_invoke Configured BackgroundFetch 2024-10-18 06:56:26.905 π<+40.98391033,-111.89461335> +/- 228.33m (speed -1.00 mps / course -1.00) @ 10/18/24, 6:56:26β―AM Mountain Daylight Time 2024-10-18 06:56:26.905 ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β -[TSLocationManager locationManager:didUpdateLocations:] Enabled: 1 | isMoving: 0 | df: -1.0m | age: 8 ms ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ 2024-10-18 06:56:26.905 β -[TSLocationManager locationManager:didUpdateLocations:] Acquired motionchange position: <+40.94316423,-111.89047783> +/- 68.46m (speed -1.00 mps / course -1.00) @ 10/18/24, 6:51:36β―AM Mountain Daylight Time 2024-10-18 06:56:26.905 π΅-[TSLocationManager startMonitoringStationaryRegion:radius:] Radius: 200 2024-10-18 06:56:26.906 π΄-[TSLocationManager stopUpdatingLocation] 2024-10-18 06:56:26.906 π΅-[TSLocationManager calculateMedianLocationAccuracy:] Median location accuracy: 68.5 2024-10-18 06:56:26.906 βΉοΈ-[PolygonGeofencingService setLocation:] Already updating location