openrouteservice icon indicating copy to clipboard operation
openrouteservice copied to clipboard

VehicleFlagEncoder.adjustSpeedForAcceleration can cause irrational routing result

Open marq24 opened this issue 5 years ago • 1 comments

This route seams to be irrational...

https://maps.openrouteservice.org/directions?n1=47.449908&n2=11.933389&n3=17&a=47.450053,11.933459,47.450902,11.935626&b=0&c=0&k1=en-US&k2=km

The B171 have a speed limit of 70km/h - while by the default the track (grade1) have a limit of 40km/h - why the routing still believe, that a route with a length of 303m (@40km/h) is faster then a route with a length of 190m (@70km/h)...

Well the reason is, that we have introduced a speed adjustment in the car flag encode in order to get more reasonable inner city travel times - the train of though is, that a vehicle have to accelerate & decelerate on a way.

In this specific section the B171 consist of 3 very short sections (ways) - see: https://www.openstreetmap.org/edit?relation=1016862#map=19/47.45045/11.93451 the "adjust speed" code is responsible that on this short sections the speed is way below 40km/h...

When you disable in the app.config the use_acceleration=false (in the profile-vehicles-car.parameters.encoder_options) and regenerate the graphs you will get the "expected" route (stay on the B171)

I suggest to adjust the ACCELERATION_SPEED_CUTOFF_MAX from 80 to at least 60 (in the org.heigit.ors.routing.graphhopper.extensions.flagencoders.VehicleFlagEncoder) - even if in some cities there are mayor inner-city Bundesstraßen with a speed limit of 70km/h (like here on the Nordring in Gütersloh (https://www.openstreetmap.org/edit?relation=1016862#map=17/51.90970/8.36191)

PS: I have prepared a osm.gz file of the area (but for what ever reason I am not able to attach the osm.gz here - (also not as simple zip ?!))

marq24 avatar Feb 12 '20 13:02 marq24

Similar to https://github.com/GIScience/openrouteservice/issues/622

aoles avatar Feb 12 '20 13:02 aoles

This issue does not seem to persist on ORS v7. I'll close this issue. Please reopen it with a new example, if the issue still persists.

sfendrich avatar Oct 11 '23 11:10 sfendrich