Mapping OSM way id to corresponding edge id list

What is the best approach to get internal edges id list from OSM way ID?

Input: OSM way id
Output: internal edges ids

I need to change speed of corresponding internal edges ids from OSM way ID input. would that be possible?


look at OSM Data in GraphHopper 3.0

Tks for your answer. But my purpose is reverse of your answer, get internal edges from osm way id.
Input: OSM way id
Output: internal edges ids
Can you give me advice ?

This information is easily available in OSMReader. For example for GraphHopper 5.3 take a look here:

way.getId() will be the OSM way ID and edge.getEdge() the corresponding GraphHopper edge ID. There can be multiple GraphHopper edges per way, though. You could either just print this information somewhere or put it into a hash table etc.

If you do not want to modify the OSMReader directly you could also add your own TagParser and use the applyWayTags method for this.

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