Hi! I’m new to Graphhopper, I managed to get the graphhopper-web-10.2.jar routing engine work with build-in car and foot profiles, but creating a working custom profile seems to be impossible. I’d like to use GH for emergency vehicle routing, and i created a simple ambulance.json file containing following:
{
“speed”: [
{
“if”: “true”,
“multiply_by”: “1.2”
}
]
}
Basically I just wanted to multiply speeds with 1.2.
In config.yml I added to profiles section:
- name: ambulance
custom_model_files: [ambulance.json]
When importing the config, I get
2025-06-20 10:57:33.261 [main] INFO com.graphhopper.GraphHopper - version 10.2|2025-01-20T08:40:08Z (9,23,7,5,2,9)
java.lang.IllegalArgumentException: Could not create weighting for profile: ‘ambulance’.
Profile: name=ambulance|turn_costs={null}|weighting=custom|hints={custom_model_files=[ambulance.json], custom_model=distanceInfluence=null|headingPenalty=null|speedStatements=[{“if”: “true”, "multiply_by: “1.2”}]|priorityStatements=|areas=}
Error: Cannot compile expression: The first group needs to contain a single unconditional ‘if’ statement (or end with an ‘else’).
I just don’t understand what I’m doing wrong. Any ideas?