When using the /directions/driving-hgv route, everything works fine, including for long distances.
However, when I add the following options to avoid ferries:
# if avoid_ferries:
# body["options"] = {"avoid_features": ["ferries"]}
I get the following error message:
{
"error": {
"code": 2004,
"message": "Request parameters exceed the server configuration limits. By dynamic weighting, the approximated distance of a route segment must not be greater than 100000.0 meters."
},
"info": {
"engine": {
"build_date": "2025-01-27T14:56:02Z",
"graph_version": "1",
"version": "9.0.0"
},
"timestamp": 1763998198502
}
}
From my understanding, the configuration parameter maximum_segment_distance_with_dynamic_weights
is set to 20000000, so I would expect this limit to apply instead of 100000.0 meters.
Is there something I am missing in the configuration, or is this a bug?
Hi, thanks for reaching out and for choosing openrouteservice!
There is no such configuration parameter as maximum_segment_distance_with_dynamic_weights. There is, however, one named maximum_distance_dynamic_weights. The error message you are receiving indicates that this parameter is set to its default value of 100000 meters, so you might want to set it to a higher value in order to address the issue.
On a side note, your current value of maximum_snapping_radius: 20000000 is probably misconfigured. This parameter controls the distance limit for matching the provided coordinates to the road network. The default value of 400 meters means that no route will be found for any points that are farther from roads than this value. Therefore it’s rather impractical to set this parameter to a value higher than a few thousand meters. You will find more details on the configuration parameters in the documentation.
I understand now, I was actually misled by this page in the documentation:
When I searched my issue on Google, this page for version 9.5.1 came up, and it still contains a reference to the parameter maximum_segment_distance_with_dynamic_weights. Even though this appears in the deprecated JSON configuration file, it can easily cause confusion when troubleshooting.
In any case, thank you for the clarification and for pointing me to the correct parameter!