I'm in the process of creating a offline GPS navigation application using Graphhopper-offline, OpenStreetMap data and GPS coordinates read every second from a android device.
So far I have managed to read in the GPS coordinates, get route instructions from graphhopper and update my position on a map. But when I test with real data there are large number of points which are not actually on the route and due that I am getting incorrect routing instructions from graphhopper.
To eliminate this I tried using a Kalman filtering approach given as a answer to the stackoverflow question
But still I get a considerable number of wrong results. I cannot post my exact code since this is for a product. My approach is,
1. Get user to set the destination
2. Read initial position from GPS data
3. Get start-to-destination instructions from graphhopper
4. Display instruction
5. Read GPS position every second. Set current position as start
6. Repeat steps 3,4 until he reaches the destination.
In order to smoothen the path I'am getting Kalman predicted value for each GPS postion read. But I am getting inaccurate points more than acceptable.
I will be really thankful if you can help me with this by pointing out what I am doing wrong or a way to get this fixed. I am not asking for code, at least point in the correct direction will help me a lot.