I’m looking to incorporate some custom OSM tags directly into GraphHopper’s routing logic, but I’m running into a challenge. Specifically, I have OSM ways that include a lot of new attributes, for example:
sw_thru_park (1 if true, 0 if false)
sw_red_route (1 if true, 0 if false)
My goal is to make these attributes available as encoded values so that I can reference them directly in a custom model (i.e., weighting: "custom") without having to maintain an external cache or preprocessing step on my side.
I’m not sure what you are trying to avoid and what would be acceptable. But the standard way of doing this would be to take any other OSM tag/encoded value that is already supported as a blue print and add the needed code analogously. For example take a look at RoadClassLink.java and the corresponding parser OSMRoadClassLinkParser.java and their usages in DefaultImportRegistry.java. It should be fairly easy to add some SwThruPark and SwRedRoute encoded values this way. Once they are available in the graph you can use them in your custom model.