I need to get access to the highway type (e.g. motorway, primary) of the nodes in a map-matched route for some extra processing, but I’m struggling to work out how. What I’d like is to be able to have a clean lookup from some code iterating over the information in a MatchResult object.
From reading the forum it looks like a new FlagEncoder is required to do this, but all the posts only have code fragments, and not a complete picture of what is needed to achieve this.
I think the answer is along the lines of:
a) add the new encoder string into routing/util/FlagEncoderFactory.java
b) create the new encoder class, extending off an existing one as appropriate, ensuring the “toString” method returns the string added to the factory
c) define methods defineWayBits, handleWayTags and applyWayTags (I guess this is for the OSM parser to use to encode the data into the GraphHopper format)
I’ve not seen a method for being able to read the new data, and neither is it clear how to access this from entries in a MatchResult.
Can anyone provide more detail to this?