Search in sources :

Example 6 with ConditionalTagInspector

use of com.graphhopper.reader.ConditionalTagInspector in project graphhopper by graphhopper.

the class ConditionalOSMTagInspectorTest method testConditionalAllowanceSingleDay.

@Test
public void testConditionalAllowanceSingleDay() {
    Calendar cal = getCalendar(2015, Calendar.DECEMBER, 27);
    ConditionalTagInspector acceptor = new ConditionalOSMTagInspector(cal, getSampleConditionalTags(), getSampleRestrictedValues(), getSamplePermissiveValues());
    ReaderWay way = new ReaderWay(1);
    way.setTag("vehicle:conditional", "yes @ (Su)");
    assertTrue(acceptor.isRestrictedWayConditionallyPermitted(way));
}
Also used : ConditionalTagInspector(com.graphhopper.reader.ConditionalTagInspector) ReaderWay(com.graphhopper.reader.ReaderWay) Test(org.junit.Test)

Example 7 with ConditionalTagInspector

use of com.graphhopper.reader.ConditionalTagInspector in project graphhopper by graphhopper.

the class ConditionalOSMTagInspectorTest method testConditionalReject.

@Test
public void testConditionalReject() {
    Calendar cal = getCalendar(2014, Calendar.MARCH, 10);
    ConditionalTagInspector acceptor = new ConditionalOSMTagInspector(cal, getSampleConditionalTags(), getSampleRestrictedValues(), getSamplePermissiveValues());
    ReaderWay way = new ReaderWay(1);
    way.setTag("vehicle:conditional", "no @ (Mar 10-Aug 14)");
    assertTrue(acceptor.isPermittedWayConditionallyRestricted(way));
}
Also used : ConditionalTagInspector(com.graphhopper.reader.ConditionalTagInspector) ReaderWay(com.graphhopper.reader.ReaderWay) Test(org.junit.Test)

Aggregations

ConditionalTagInspector (com.graphhopper.reader.ConditionalTagInspector)7 ReaderWay (com.graphhopper.reader.ReaderWay)7 Test (org.junit.Test)7