transistorsoft / react-native-background-geolocation

Sophisticated, battery-conscious background-geolocation with motion-detection
http://shop.transistorsoft.com/pages/react-native-background-geolocation
MIT License
2.66k stars 426 forks source link

Android coordinates roundoff #2206

Closed tousif-v closed 1 week ago

tousif-v commented 1 week ago

Environment

`BackgroundGeolocation.ready({ enableHeadless: true, stationaryRadius: 0, desiredAccuracy: BackgroundGeolocation.DESIRED_ACCURACY_HIGH, distanceFilter: 0, stopTimeout: 5, debug: false, // <-- enable this hear sounds for background-geolocation life-cycle. logLevel: BackgroundGeolocation.LOG_LEVEL_VERBOSE, stopOnTerminate: false, // <-- Allow the background-service to continue tracking when user closes the app. startOnBoot: true, // <-- Auto start tracking when device is powered-up.

// useSignificantChangesOnly: true,

stopOnStationary: false,
allowIdenticalLocations: true,

locationUpdateInterval: 1000,
fastestLocationUpdateInterval: 60 * 1000,

showsBackgroundLocationIndicator: true,
heartbeatInterval: 60, // 1 min Interval
preventSuspend: true, // iOS need to work heartbeatInterval
autoSync: false, // Disable automatic syncing (this doesn't directly prevent permission requests but is a common recommendation)

// Android & iOS location-services will never turn off
disableStopDetection: true,
pausesLocationUpdatesAutomatically: false, // Need for iOS to set location-services will never turn off along with disableStopDetection

})`

Expected Behavior

In Android coordinates should not roundoff

Actual Behavior

In Android coordinates are roundoff, only 6 digits after the decimal point (eg. 37.4220936 , -122.083922)

christocracy commented 1 week ago

Coordinates are not rounded.

if you’re observing this in the logs, that’s the native Android api Location.toString() method doing that. The raw data provided to you is NOT rounded.

tousif-v commented 1 week ago

Is there any way to avoid this?

christocracy commented 1 week ago

There is no way to tell the Location API to not round coords when printing to the logs.

it’s not important.