Baseflow / flutter-geolocator

Android and iOS Geolocation plugin for Flutter
https://baseflow.com/
MIT License
1.24k stars 653 forks source link

Inaccurate Location Tracking: Randomly Drifting GPS Points #1574

Open Gonn01 opened 1 month ago

Gonn01 commented 1 month ago

Please check the following before submitting a new issue.

Please select for which platform(s) you need help

Your question

I'm developing a Flutter application to track the user's location every 30 seconds and generate a route.

I've encountered an issue where the package occasionally records GPS coordinates that are significantly far from the device's actual location, causing unexpected deviations in the generated route. These inaccurate readings seem to occur randomly and then correct themselves after a short period.

  final LocationSettings locationSettings = AndroidSettings(     
    intervalDuration: const Duration(seconds: 30),
    accuracy: LocationAccuracy.bestForNavigation,
    foregroundNotificationConfig: const ForegroundNotificationConfig(
      // Explain to the user why we are showing this notification.
      notificationText:
          'App will continue to receive your location even when you arent'
          ' using it',
      // Tell the user what we are doing.
      notificationTitle: 'Running in Background', 
      // Give the notification an amber color.
      color: Colors.amber, setOngoing: true,
    ),
  );
  Geolocator.getPositionStream(locationSettings: locationSettings).listen(
    (Position position) async {
      await BackGpsRepository().checkAndSend(position);
    },
  );

Expected Behavior: The package should consistently provide accurate GPS coordinates, allowing for the generation of a smooth and realistic route.

Actual Behavior: The package intermittently records GPS coordinates that are significantly off, resulting in a distorted route with unexpected jumps.

Additional Information:

Package Version: 13.0.1 Flutter Version: 3.22.3 Affected Devices: g54 Motorola Operating Systems: Android Permissions in AndroidManifest:

In this case i stay on the same position and randomly throw a position far away and comeback later. Screenshot_20240920-131135 (1)

Version

13.0.1

abdull-rahmann commented 1 week ago

Please check the following before submitting a new issue.

Please select for which platform(s) you need help

  • [x] Android
  • [ ] iOS
  • [ ] Linux
  • [ ] macOS
  • [ ] Web
  • [ ] Windows

Your question

I'm developing a Flutter application to track the user's location every 30 seconds and generate a route.

I've encountered an issue where the package occasionally records GPS coordinates that are significantly far from the device's actual location, causing unexpected deviations in the generated route. These inaccurate readings seem to occur randomly and then correct themselves after a short period.

  final LocationSettings locationSettings = AndroidSettings(     
    intervalDuration: const Duration(seconds: 30),
    accuracy: LocationAccuracy.bestForNavigation,
    foregroundNotificationConfig: const ForegroundNotificationConfig(
      // Explain to the user why we are showing this notification.
      notificationText:
          'App will continue to receive your location even when you arent'
          ' using it',
      // Tell the user what we are doing.
      notificationTitle: 'Running in Background', 
      // Give the notification an amber color.
      color: Colors.amber, setOngoing: true,
    ),
  );
  Geolocator.getPositionStream(locationSettings: locationSettings).listen(
    (Position position) async {
      await BackGpsRepository().checkAndSend(position);
    },
  );

Expected Behavior: The package should consistently provide accurate GPS coordinates, allowing for the generation of a smooth and realistic route.

Actual Behavior: The package intermittently records GPS coordinates that are significantly off, resulting in a distorted route with unexpected jumps.

Additional Information:

Package Version: 13.0.1 Flutter Version: 3.22.3 Affected Devices: g54 Motorola Operating Systems: Android Permissions in AndroidManifest:

In this case i stay on the same position and randomly throw a position far away and comeback later. Screenshot_20240920-131135 (1)

Version

13.0.1

Any answers? To solve it , I got the same issue

Gonn01 commented 1 week ago

Please check the following before submitting a new issue.

Please select for which platform(s) you need help

  • [x] Android
  • [ ] iOS
  • [ ] Linux
  • [ ] macOS
  • [ ] Web
  • [ ] Windows

Your question

I'm developing a Flutter application to track the user's location every 30 seconds and generate a route. I've encountered an issue where the package occasionally records GPS coordinates that are significantly far from the device's actual location, causing unexpected deviations in the generated route. These inaccurate readings seem to occur randomly and then correct themselves after a short period.

  final LocationSettings locationSettings = AndroidSettings(     
    intervalDuration: const Duration(seconds: 30),
    accuracy: LocationAccuracy.bestForNavigation,
    foregroundNotificationConfig: const ForegroundNotificationConfig(
      // Explain to the user why we are showing this notification.
      notificationText:
          'App will continue to receive your location even when you arent'
          ' using it',
      // Tell the user what we are doing.
      notificationTitle: 'Running in Background', 
      // Give the notification an amber color.
      color: Colors.amber, setOngoing: true,
    ),
  );
  Geolocator.getPositionStream(locationSettings: locationSettings).listen(
    (Position position) async {
      await BackGpsRepository().checkAndSend(position);
    },
  );

Expected Behavior: The package should consistently provide accurate GPS coordinates, allowing for the generation of a smooth and realistic route. Actual Behavior: The package intermittently records GPS coordinates that are significantly off, resulting in a distorted route with unexpected jumps. Additional Information: Package Version: 13.0.1 Flutter Version: 3.22.3 Affected Devices: g54 Motorola Operating Systems: Android Permissions in AndroidManifest: In this case i stay on the same position and randomly throw a position far away and comeback later. Screenshot_20240920-131135 (1)

Version

13.0.1

Any answers? To solve it , I got the same issue

I think is something with the battery optimization of the device but im not sure

GohelBrijesh commented 1 week ago

Any answers? To solve it, the same issue occurred in my application while using map navigation.

NhaPCS commented 1 week ago

I got same issue, plz help

NhaPCS commented 1 week ago

are you guys also using mapbox?

hussenIbrahim commented 1 week ago

are you guys also using mapbox?

Yes ,