January 11, 2023, 2:46pm
I am runnning my own instance of GraphHopper.
I would like to display countries that a route goes through.
Also, I need to display a list of nodes (that belong to the route) with some specific tags (like
k="highway" v="traffic_signals" and many more).
How could I achieve this? Which java classes should I rewrite / modify?
Thank you very much
January 12, 2023, 3:06pm
Displaying countries is very easy. You just need to do add
graph.encoded_values, run a new import (!), and request the corresponding
country path detail.
Displaying traffic_signals is much more involved. You need to parse this information from the OSM file and make it available in the routing response. This PR could be a good start for this:
Make use of node tags like 'highway' or 'crossing' by easbar · Pull Request #2705 · graphhopper/graphhopper · GitHub
January 12, 2023, 4:26pm
Thank you. What if I had to display train stations with a tag of
January 12, 2023, 7:18pm
For a railway router? These tags seem to only be located along railways, so I am not sure what you mean?
January 12, 2023, 7:36pm
Yes, for a railway router.
January 12, 2023, 7:53pm
Ok, then it would be the exact same as for traffic_signal. It does not matter what kind of node tag it is. Or are you wondering how to implement a railway router?
January 12, 2023, 8:08pm
I am trying to implement railway router using
GitHub - geofabrik/OpenRailRouting: routing on railway tracks using OpenStreetMap data and the GraphHopper routing engine, but I am failing to retrieve countries (even though I updated
graph.encoded_values) that route goes through and I also need train stations that are at the borders (have the tag
Tag:railway=border - OpenStreetMap Wiki)
January 12, 2023, 8:15pm
Ok, I don’t know the details of OpenRailRouting. But for speaking of the GraphHopper code reading railway=border for railways should be the exact same as reading traffic_signals for highways.
January 12, 2023, 8:16pm
If I follow the same approach that is shown in the Pull Request, I should be able to retrieve train station names that are at the border?
January 13, 2023, 10:08am
Yes, you should receive all node tags whatsoever
January 13, 2023, 12:17pm
It seems I would need to define all train station names in the enum, no?
January 17, 2023, 5:12pm
Thank you guys very much (
@karussell and @easbar). I managed to make it work. However, I noticed that
railway=border does not return the precise location of a train station. Any idea why?
January 17, 2023, 5:30pm
You mean the location is different to the actual OSM node? Or the OSM node is not were the train station is in reality? And what exactly did you do?
January 17, 2023, 5:35pm
<tag k="railway" v="border"/> represents the point of where exactly the border is, but I need the location of the train station where the transition happens. Note: it gives the correct train station name but not the location.
Tag:railway=border - OpenStreetMap Wiki
January 17, 2023, 5:52pm
Ok, but I’m afraid this is out of scope for GraphHopper or what do you think can we do about this?
April 18, 2023, 5:51pm
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.