1

As I needed to implement "snap GPS location to road" function for an Android application I've modified Android example of https://github.com/graphhopper to suit my needs. It actually did what was expected, but now I'm quite confused about data format i should provide to users device.

Is it possible to provide pbf.osm files? What should I do to provide the user as small data chunks as possible?

Or is this a completely wrong approach to achieve "snap to road" to a native Android app (not web based)?

Patman
  • 185
  • 1
  • 13
  • You can do it with graphhoper. Just deploy the created folder to the device with all the graphhopper files like it is described in the Android docs. – Karussell Aug 20 '14 at 18:29
  • BTW: if you have a GPX file with multiple GPS locations and time associated the snapping to road is called map matching. This post explains this a bit: http://karussell.wordpress.com/2014/07/28/digitalizing-gpx-points-or-how-to-track-vehicles-with-graphhopper/ – Karussell Aug 20 '14 at 20:58

1 Answers1

0

I'm not that familar with Graphhopper in detail, but please take into account that it's just an routing engine and thus tuned for that purpose.

What you are looking for is a very simple method of 'reverse geocoding' that just returns the clothest point on a road for a given geopos. This doesn't work on a (simplified) routing graph as routers does, but on a optimized structure that is just tuned for geospatial queries. Maybe there are existing offline maps frameworks that already implement it?

MaM
  • 2,043
  • 10
  • 20
  • 1
    Why should it not work? The routing engine needs this information, nothing is thrown away. – Karussell Aug 20 '14 at 20:19
  • AFAIK it's operating on a routing graph, not a geospatial representation -> the coordinates get lost because htey are processed to a disctance weight for the connecting edges along the graph. – MaM Aug 20 '14 at 20:46
  • 2
    No. They won't get lost - because how would you otherwise display the route or calculate the closest roads for your query points to do the actual routing? Instead, as you can imagine, 'snap to road' is an important part of probably every routing engine, and in GraphHopper highly tuned for speed and small size. – Karussell Aug 20 '14 at 20:49