The points generated by GH routing engine don't fit into the edge perfectly, what's wrong? Thanks for your help

图片
such as the point in the top left

The map tiles are not necessarily based on the same data as the GH routing network, so there can be deviations like this. This just depends on where you are taking the map tiles from and which data you are using for GH routing.

1 Like

I don’t quite understand what map tiles are. I downloaded the map from osm website a few months ago, and run the map matching algorithm of GH to generate the points on a edge. The visualization was done by the python folium library, so you mean I should download the map agagin?

I was just trying to say that GraphHopper only uses the OSM data to create a routing graph that is used to calculate routes. The route calculation is independent from the graph visualization in the web UI. For this we just use map tiles (raster images) from openstreetmap.org (and a few others). If you generated the map tiles yourself, using the same data I don’t know where this mismatch is coming from. I cannot tell from your post what exactly you are trying to do. Did you take the screenshot from the GraphHopper web app? One thing you could try is enabling local MVT in the layers menu of the web app. This way you should see if the GraphHopper graph matches the roads shown on the map.

The map has been generated using the python library folium, which is basically a way to use the javascript library Leaflet.js from python (no javascript skills required).
Several map tiles should be available. I’m not experienced enough to guess which one you are using, but ‘openstreetmap’ should be the one which fits your points best. There is plenty of documentation online concerning folium map tiles options, this could be a good start.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.