All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.graphhopper.routing.ev.TurnCost Maven / Gradle / Ivy

Go to download

GraphHopper is a fast and memory efficient Java road routing engine working seamlessly with OpenStreetMap data.

There is a newer version: 10.0
Show newest version
package com.graphhopper.routing.ev;

import com.graphhopper.util.BitUtil;

import static com.graphhopper.routing.util.EncodingManager.getKey;

public class TurnCost {

    public static String key(String prefix) {
        return getKey(prefix, "turn_cost");
    }

    /**
     * This creates an EncodedValue specifically for the turn costs
     */
    public static DecimalEncodedValue create(String name, int maxTurnCosts) {
        int turnBits = BitUtil.countBitValue(maxTurnCosts);
        return new DecimalEncodedValueImpl(key(name), turnBits, 0, 1, false, false, true);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy