use of uk.me.parabola.mkgmap.reader.osm.Way in project mkgmap by openstreetmap.
the class RuleFileReaderTest method testNot.
/**
* Test the not operator.
*/
@Test
public void testNot() {
RuleSet rs = makeRuleSet("tunnel=yes & !(route=mtb | route=bicycle) [0x1]");
// RuleSet rs = makeRuleSet("tunnel=yes & (route!=mtb & route!=bicycle) [0x1]");
Way el = new Way(1);
el.addTag("tunnel", "yes");
el.addTag("route", "abc");
getFirstType(rs, el);
}
use of uk.me.parabola.mkgmap.reader.osm.Way in project mkgmap by openstreetmap.
the class RuleFileReaderTest method testGetTagValueNotFound.
@Test
public void testGetTagValueNotFound() {
RuleSet rs = makeRuleSet("a=b & b<$c [0x5] a=b [0x6]");
Way w = new Way(1);
w.addTag("a", "b");
w.addTag("b", "50");
GType type = getFirstType(rs, w);
assertNotNull(type);
assertEquals(6, type.getType());
}
use of uk.me.parabola.mkgmap.reader.osm.Way in project mkgmap by openstreetmap.
the class RuleFileReaderTest method testNEAtTop.
@Test(expected = SyntaxException.class)
public void testNEAtTop() {
RuleSet rs = makeRuleSet("QUOTA != 'fred' [0x2]");
Element el = new Way(1);
el.addTag("QUOTA", "tom");
GType type = getFirstType(rs, el);
assertNotNull(type);
assertEquals(2, type.getType());
}
use of uk.me.parabola.mkgmap.reader.osm.Way in project mkgmap by openstreetmap.
the class RuleFileReaderTest method testLengthFunction.
@Test
public void testLengthFunction() {
// Its less than 92m
RuleSet rs = makeRuleSet("A=B & length() < 92 [0x5]");
Way el = getWayWithLength();
el.addTag("A", "B");
GType type = getFirstType(rs, el);
assertNotNull(type);
assertEquals(5, type.getType());
}
use of uk.me.parabola.mkgmap.reader.osm.Way in project mkgmap by openstreetmap.
the class RuleFileReaderTest method testMultipleActions.
@Test
public void testMultipleActions() {
String rstr = "highway=footway {add access = no; add foot = yes} [0x16 road_class=0 road_speed=0 resolution 23]";
RuleSet rs = makeRuleSet(rstr);
Element el = new Way(1);
el.addTag("highway", "footway");
getFirstType(rs, el);
assertEquals("access set", "no", el.getTag("access"));
assertEquals("access set", "yes", el.getTag("foot"));
}
Aggregations