use of com.graphhopper.reader.ConditionalTagInspector in project graphhopper by graphhopper.
the class ConditionalOSMTagInspectorTest method testConditionalAllowance.
@Test
public void testConditionalAllowance() {
Calendar cal = getCalendar(2014, Calendar.MARCH, 10);
ConditionalTagInspector acceptor = new ConditionalOSMTagInspector(cal, getSampleConditionalTags(), getSampleRestrictedValues(), getSamplePermissiveValues());
ReaderWay way = new ReaderWay(1);
way.setTag("vehicle:conditional", "yes @ (Mar 10-Aug 14)");
assertTrue(acceptor.isRestrictedWayConditionallyPermitted(way));
}
use of com.graphhopper.reader.ConditionalTagInspector in project graphhopper by graphhopper.
the class ConditionalOSMTagInspectorTest method testConditionalAccept.
@Test
public void testConditionalAccept() {
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 @ (Aug 10-Aug 14)");
assertFalse(acceptor.isPermittedWayConditionallyRestricted(way));
}
use of com.graphhopper.reader.ConditionalTagInspector in project graphhopper by graphhopper.
the class ConditionalOSMTagInspectorTest method testConditionalAllowanceReject.
@Test
public void testConditionalAllowanceReject() {
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));
}
use of com.graphhopper.reader.ConditionalTagInspector in project graphhopper by graphhopper.
the class ConditionalOSMTagInspectorTest method testConditionalAcceptNextYear.
@Test
public void testConditionalAcceptNextYear() {
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 @ (2013 Mar 1-2013 Mar 31)");
assertFalse(acceptor.isPermittedWayConditionallyRestricted(way));
}
use of com.graphhopper.reader.ConditionalTagInspector in project graphhopper by graphhopper.
the class ConditionalOSMTagInspectorTest method testConditionalSingleDay.
@Test
public void testConditionalSingleDay() {
Calendar cal = getCalendar(2015, Calendar.DECEMBER, 27);
ConditionalTagInspector acceptor = new ConditionalOSMTagInspector(cal, getSampleConditionalTags(), getSampleRestrictedValues(), getSamplePermissiveValues());
ReaderWay way = new ReaderWay(1);
way.setTag("vehicle:conditional", "no @ (Su)");
assertTrue(acceptor.isPermittedWayConditionallyRestricted(way));
}
Aggregations