Reputation: 11
I have a transport android app and please try help me understand why the polylines appear to be moving irratically and sometimes completely off the road? Would it help to put bounds in that the new position can't jump more than a certain distance from the previous position? Thanks.
Upvotes: 0
Views: 1466
Reputation: 4784
If you are displaying users' GPS locations as polyline on the maps, then you might want to snap it on the road with the Google newly published Google Maps Roads API's snapToRoads function.
Basically what it does it to correct the GPS information onto the road. Since 1 picture worth 1000 words, see it yourself.
But currently they only provided a restful and javascript API, for Android, you need to call it through the restful services.
Google provided a github project for that, you can check its MainActivity out here:
https://github.com/googlemaps/roads-api-samples/blob/master/app/src/main/java/com/google/example/maps/roadsapi/MainActivity.java
Upvotes: 1