3

I am tracking rider's location(bike rider) and calculating total distance travelled per session by him. I have used fused location api only (no GPS). There are times when I am getting jumps in location and due to these jumps extra distance is added,hence results in overall wrong distance. Please help me in finding these wrong latitude and longitudes. Is there any good filter which can be easily implemented in Android or any good method for the same?

Sakshi Gupta
  • 116
  • 11

3 Answers3

1

Distance measurement on raw GPS data will always be noisy, because the underlying data is often inaccurate. These jumps are due to inaccurate location measurements. To achieve, accurate distance measurements, you can need to filter the noise in the data.

Some useful filtering techniques that you can explore are:

  1. Smoothening location data using Kalman filters - see tutorial

  2. Snapping to road with Google maps snap-to-roads API, or OSRM match service.

If you are looking for an end-to-end solution that gives accurate location data and distance measurements, you can also try the HyperTrack SDK for Android or iOS. You can read about how they filter locations to improve accuracy on their blog. (Disclaimer: I work at HyperTrack.)

arjunattam
  • 2,679
  • 18
  • 24
0

Location isn't exact. Even with GPS it isn't. Fused location can be off by hundreds of meters. If you're standing still every few minutes you'll get one reading that's just really off. Sometimes I walk from my kitchen to the bathroom and it thinks I've gone a quarter mile. If you look at the accuracy it returns, remember that there's a 2/3 chance you're within that distance. There's still a 33% chance that you're nowhere within that radius.

You're going to have to accept inaccuracy. There are a few ideas you can do though

1)Ignore all updates unless they travel at least some minimum distance. Adding in all those little amounts will add a lot of inaccuracy quickly. 2)Require at least 2 updates near a new location before accepting that as the new location.

But if you're using network location for short movements- you're going to have a difficult time of it.

Gabe Sechan
  • 90,003
  • 9
  • 87
  • 127
  • I am requesting location update after every 30 sec and getting an error of approx 1-1.5km in total distance travelled. – Sakshi Gupta Mar 07 '16 at 14:22
  • I'm not really surprised by that. FusedProvider calls it "block accuracy" for a reason- they expect it to get within about a city block. The flip side of that is that if you're standing still its going to give you a bunch of points within a block of you more or less randomly. – Gabe Sechan Mar 07 '16 at 14:24
  • Read about using Kalman Filter for the same but I am not sure how to implement this in my Android Code. It would be great if somebody help me in implementing Kalman Filter with current latitude, longitude, accuracy, time and changed latitude, longitude on locationChanged. – Sakshi Gupta Mar 08 '16 at 06:27
0

Go to Settings -> Location -> Mode. And make sure the mode is set to Device only. This will stops the jump