Implicit speed limit cap for HGV?

I’ve been trying to figure out why there seems to be an implicit speed limit for HGV profile, even though I’ve changed the maxPossibleSpeed in HeavyVehicleFlagEncoder.java
to 140 (~86 mph) and removed the 90% speed reduction in VehicleFlagEncoder.java.

This entire segment has an explicit maxspeed=85 mph (some are 80 mph), but the result returned from my local instance with the above modifications never goes past 65 mph. The only thing I could think of is that it’s capping the speed limit based on the motorway speed in heavyvehicle.json, which is set to 65 mph (105 km/h). But if I understand correctly from this official docs on travel speed calculation, it should only this speed if there’s no explicit maxspeed tag. Are there more factors that affect the travel speed for HGV?

Thanks for reaching out! :heart:

The reported distance and travel time on the road segment corresponding to OSM way 1082711859 for regular car are 661.5 meters and 36.6 seconds, which translates to a travel speed of 125 km/h (77 mph). This is in line with the maxpseed tag of 85 mph and the speed reduction by 10%.

For hgv the travel time increases to 36.6 seconds corresponding to 65 km/h. This is indeed lower than expected and most probably caused by the vary same mechanism as described in issue#1800.

You can disable the acceleration-based speed reduction by setting use_acceleration: false in the encoder options of your application config file.

Cheers,
Andrzej

1 Like

Thank you the for response!

I’ve tried disabling acceleration in the config and it didn’t seem to do much in this specific case. However, changing the motorway speed to 140 (~85mph) in heavyvehicle.json did result in the correct speed, which is odd since the segment has an explicit maxspeed tag, so it should’ve just used that?