Hello!
I’m trying to create a new profile for small trucks & trucks.
(light commercial vehicles; e.g., goods vehicles with a maximum allowed mass of up to 3.5 tonnes)
(heavy goods vehicle; e.g., goods vehicles with a maximum allowed mass over 3.5 tonnes)
For this I have extended CarFlagEncoder. But I need to add more restrictions like maxHeight or maxWeight.
https://wiki.openstreetmap.org/wiki/Key:maxheight
https://wiki.openstreetmap.org/wiki/Key:maxweight
Somthing like:
goods=no
hgv=no
or:
maxweight:hgv=5 st
Can I add them inside constructor?
public SmallTruckEncoder() {
this(new PMap());
}
public SmallTruckEncoder(int speedBits, double speedFactor, int maxTurnCosts) {
this(new PMap().putObject("speed_bits", speedBits).putObject("speed_factor", speedFactor).
putObject("max_turn_costs", maxTurnCosts));
}
public SmallTruckEncoder(PMap properties) {
super(properties.getInt("speed_bits", 5),
properties.getDouble("speed_factor", 5),
properties.getInt("max_turn_costs", properties.getBool("turn_costs", false) ? 1 : 0));
intendedValues.add("delivery");
restrictedValues.remove("delivery");
// todo add more restrictions
}
If yes, so how I can do it? And in which values do I need add this restrictions? For example: tonnes, kilogramms etc.
Useful links:
https://wiki.openstreetmap.org/wiki/Key:goods
https://wiki.openstreetmap.org/wiki/Key:access#Land-based_transportation
Here is the example how the developer trying to add max_weight & max_height in yml - Restrictions are not considered with flex profile
Can't set max_width (or max_weight / height) in .yml file
How I can do this in Java config?
restrictedValues.add("maxweight:goods=3.5");
or
restrictedValues.add("maxweight:goods='3.5'");