GraphHopper.com | Forum | GitHub | Maps | Blog

What data is stored in the graph?


#1

I’m wanting to implement a feature request on the Graphhopper repo, which is about reporting which countries/areas a route passes through.

But how do I get the country data? I was thinking of saving the country data with each node (or more likely have a node on the border with a border tag), but I assume that means that the graph needs to be updated to accommodate that?


#2

This should be solvable using SpatialRules. I think at the moment it might be better to do this on the fly (using the SpatilIndex in the PathDetails). We have a json file for all countries (or pretty much every country) in GraphHopper. Rightnow you would have to write SpatialRules for every country, this should be changed for this feature and load a default SpatialRule for every country.

Have a look how it currently works by checking the tests here and here.

Cheers,
Robin