I am trying to run graphhopper locally and I have a custom profile I set up named small_truck.json
, however when I start up the server, I get the following error:
Profile: name=small_truck|turn_costs={null}|weighting=custom|hints={custom_model_files=[small_truck.json], custom_model=distanceInfluence=null|headingPenalty=null|speedStatements=[{"if": "road_class == MOTORWAY", "multiply_by": 0.8}, {"else": "null", "multiply_by": 1.0}]|priorityStatements=[{"if": "road_class == MOTORWAY", "multiply_by": 0.5}, {"else": "null", "multiply_by": 1.0}]|areas=[]}
Error: Cannot compile expression: The first block needs to end with an 'else' (or contain a single unconditional 'if' statement).
My small_truck.json profile is below:
{
"priority": [
{
"if": "road_class == MOTORWAY",
"multiply_by": 0.5
},
{
"else_if": "road_class == TRUNK",
"multiply_by": 0.5
},
{
"else_if": "road_class == PARKWAY",
"multiply_by": 0.1
},
{
"else": "",
"multiply_by": 1.0
}
],
"speed": [
{
"if": "road_class == MOTORWAY",
"multiply_by": 0.8
},
{
"else_if": "road_class == TRUNK",
"multiply_by": 0.8
},
{
"else_if": "road_class == PARKWAY",
"multiply_by": 0.5
},
{
"else": "",
"multiply_by": 1.0
}
]
}
Any help is appreciated, thanks you!