I have a roads data set (in osm.pbf format) with the average driving speed for each road segment. What would be the best way to specify that GraphHopper should use these speeds for routing and not default speeds per road type? The average driving speed for each road segment is stored as “maxspeed” in a “other_tags” field in my osm.pbf file.
You should adjust one of the existing or write your own FlagEncoder that does this. The most important methods are getAccess(ReaderWay) where you specify whether or not an OSM way should be considered accessible for your vehicles and handleWayTags where you should read your maxspeed tag and set the speed and access flags (take a look at AbstractFlagEncoder to see how this works).