Map matching - get only ways id

Hi, I use graphhopper on my projects, thank you for developing it!
The msp-matching API returns route many points. I want in response only OSM way (id) or nodes id, is it possible?
Can I implement this functionality on my fork?

Hi, I wanna do the same thing as yours, but I failed at the very beginning, so could you pls tell me how to do that(configuration and build and anything else but necessary). Thanks in advance!

After GraphHopper imports the OSM data it no longer stores the OSM node and way IDs so they are not accessible when routes are calculated (or map-matching is used).

However, this feature is requested quite frequently and some community members have already worked on doing this in their own forks. You should use the forum’s search capabilities and specifically take a look at these discussions:

And maybe it would be useful if you explained why you want to retrieve the OSM IDs and what you intend to do with them.

Thanks for the answer, I would be glad if this feature is included in the next releases. I use it in combination with an OSM file, for example, you can watch the tags of received ways.

Ok the closest thing to this are probably path details. GraphHopper keeps certain road attributes (like road class or surface as so called ‘encoded values’ and it is possible to retrieve these attributes for the calculated routes using the details parameter.

@easbar
Sorry for the delay. Yes, but I would like to be able to access any attributes (incl. custom), not only encoded values.

You can create your own encoded values or feed the OSM way tags as strings into the StringIndex. See e.g. this code of a not yet merged branch.

@karussell
It seems this might solve my task, thanks, it’s interesting. When is the merge expected?

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