This is a very cool feature! In light of your request on feedback about usage and examples I’ll briefly describe how I’m using it to provide routes for emergency vehicles in case it’s helpful for someone else to see:
I create a new FlagEncoder by copying the car flag encoder https://github.com/graphhopper/graphhopper/blob/master/core/src/main/java/com/graphhopper/routing/util/CarFlagEncoder.java and modifying the speeds like so
double emergencyCarSpeedIncrease = 1.5;
// autobahn
defaultSpeedMap.put("motorway", (int) emergencyCarSpeedIncrease * 100);
defaultSpeedMap.put("motorway_link", (int) emergencyCarSpeedIncrease * 70);
...
I reference this new encoder in DefalutFlagEncoderFactory.java and FlagEncoderFactory.java.
I then create a yaml profile with other specifics (vehicle size, etc.) and modify the config.yml like so:
line 11: graph.flag_encoders: car, emergencycar
line 19: graph.encoded_values: max_weight,max_height,max_width
line 43+:
- name: emergencycar
vehicle: emergencycar
weighting: custom
custom_model_file: ./emergencycar.yml
I can now make requests to my server using the route-custom?profile=emergencycar endpoint!