Retrieving edge id inside of TagParser

Hello,
I’m trying to create map of edgeId to osm way id. On github issue someone told me to use TagParser for it, but I have no idea how to extract edge id inside of parser. Code looks something like this:

 override fun handleWayTags(edgeFlags: IntsRef, way: ReaderWay, relationFlags: IntsRef): IntsRef {
        val wayId = way.id
        // edgeId??
        // save(wayId,edgeId)
        return edgeFlags
    }

I am not sure that edgeFlags represents. Can I extract edge id from it? If it is possible, can you hint me how to start?

Thanks!

The edgeId is not available at this point, because the edge wasn’t created yet. edgeFlags does not contain this information. If I was you I would just fork the code and modify the OSMReader#addEdge method so it does what you are trying to achieve.

Related: https://github.com/graphhopper/graphhopper/issues/2649

Powered by Discourse