Search code examples
graphhopper

How to create graph file from custom street centerline map for use by graphhopper


Graphhopper looks like exactly what I need to be able to reverse geocode, snap to grid, and route.

I have a custom street centerline with lots of great weighting info (one way info, "cost", speed limit) and would like to generate a graph file (or perhaps I'll need to create a custom subclass of the Graphhopper class?) to utilize this data. I've a pretty good understanding of my data, but I'm really new to the route calculation, picking it up as fast as possible. It seems I need to generate a graph from the centerline data itself. Any helpful hints regarding what modules/classes build the graphs from the OSM data would be greatly appreciated. I'm sure I'll find it eventually myself, but I'm sure others would also appreciate finding some hints here. I'll be happy to supply more detail and share the process I go through once I actually implement, either here or as additional info in the documentation.


Solution

  • If I understand your use case properly you should look into the OSMReader and *FlagEncoder classes. Also have a look into custom readers like for shapefile, navteq (generic converter) and ordnance survey here