add min/max speed to routingSpeed

This commit is contained in:
MadWasp79 2019-11-05 18:51:36 +02:00
parent 934d0e8ab9
commit 2ffc78a0c2

View file

@ -396,7 +396,7 @@ public class GeneralRouter implements VehicleRouter {
@Override @Override
public float defineRoutingSpeed(RouteDataObject road) { public float defineRoutingSpeed(RouteDataObject road) {
float spd = getObjContext(RouteDataObjectAttribute.ROAD_SPEED).evaluateFloat(road, defaultSpeed); float spd = getObjContext(RouteDataObjectAttribute.ROAD_SPEED).evaluateFloat(road, defaultSpeed);
return spd; return Math.max(Math.min(spd, maxSpeed), minSpeed);
} }