How I can add maxWeight & maxHeight restrictions for small_truck profile in Java Config?

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.

Somthing like:
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));


        // 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:

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?

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.