Search in sources :

Example 1 with Toll

use of com.graphhopper.routing.ev.Toll in project graphhopper by graphhopper.

the class OSMTollParser method handleWayTags.

@Override
public IntsRef handleWayTags(IntsRef edgeFlags, ReaderWay readerWay, IntsRef relationFlags) {
    Toll toll;
    if (readerWay.hasTag("toll", "yes")) {
        toll = Toll.ALL;
    } else if (readerWay.hasTag(HGV_TAGS, Collections.singletonList("yes"))) {
        toll = Toll.HGV;
    } else if (readerWay.hasTag("toll", "no")) {
        toll = Toll.NO;
    } else {
        toll = Toll.MISSING;
    }
    CountryRule countryRule = readerWay.getTag("country_rule", null);
    if (countryRule != null)
        toll = countryRule.getToll(readerWay, TransportationMode.CAR, toll);
    tollEnc.setEnum(false, edgeFlags, toll);
    return edgeFlags;
}
Also used : CountryRule(com.graphhopper.routing.util.countryrules.CountryRule) Toll(com.graphhopper.routing.ev.Toll)

Aggregations

Toll (com.graphhopper.routing.ev.Toll)1 CountryRule (com.graphhopper.routing.util.countryrules.CountryRule)1