Snapping the user position to route

Friday, March 10, 2023

Snapping the measured GPS postition to the route was something which I had to implement. Luckily I've found a solution to overcome this problem.

I also just released a new test version for Android and iOS. The most important change is the interval at which the GPS position is retrieved. I have set this from 10s to 2s. Unfortunately, on Android there seems to be a minimum of 5 seconds between two measurements. More readings will likely drain your battery faster.

Snap position marker on route

Placing the position marker on the route should now also go better. For illustration I have shown the measured GPS position as a green marker.

If the measured position is less than 10m from the route, the app will still place you on the route (top image). In the right image the deviation is greater than 10m and the measured GPS position is maintained.

Measured GPS position to route
Measured GPS position snapped to route

Measured GPS position not snapped to route
Measured GPS position not snapped to route

GPS simulator

My GPS Simulator also got an update. I can now indicate how many meters of deviation I want to add to a measured location. This is very useful for testing the above, for example.


⇦ I had to make my own GPS simulator for Android and iOS

Kalman filter might help to predict current position ⇨