use of com.graphhopper.storage.IntsRef in project graphhopper by graphhopper.
the class OSMHazmatTunnelParserTest method testNoNPE.
@Test
public void testNoNPE() {
ReaderWay readerWay = new ReaderWay(1);
IntsRef intsRef = em.createEdgeFlags();
parser.handleWayTags(intsRef, readerWay, relFlags);
assertEquals(HazmatTunnel.A, hazTunnelEnc.getEnum(false, intsRef));
}
use of com.graphhopper.storage.IntsRef in project graphhopper by graphhopper.
the class OSMHazmatTunnelParserTest method testADRTunnelCat.
@Test
public void testADRTunnelCat() {
IntsRef intsRef = em.createEdgeFlags();
ReaderWay readerWay = new ReaderWay(1);
readerWay.setTag("hazmat:adr_tunnel_cat", "A");
parser.handleWayTags(intsRef, readerWay, relFlags);
assertEquals(HazmatTunnel.A, hazTunnelEnc.getEnum(false, intsRef));
intsRef = em.createEdgeFlags();
readerWay = new ReaderWay(1);
readerWay.setTag("hazmat:adr_tunnel_cat", "B");
parser.handleWayTags(intsRef, readerWay, relFlags);
assertEquals(HazmatTunnel.B, hazTunnelEnc.getEnum(false, intsRef));
intsRef = em.createEdgeFlags();
readerWay = new ReaderWay(1);
readerWay.setTag("hazmat:adr_tunnel_cat", "C");
parser.handleWayTags(intsRef, readerWay, relFlags);
assertEquals(HazmatTunnel.C, hazTunnelEnc.getEnum(false, intsRef));
intsRef = em.createEdgeFlags();
readerWay = new ReaderWay(1);
readerWay.setTag("hazmat:adr_tunnel_cat", "D");
parser.handleWayTags(intsRef, readerWay, relFlags);
assertEquals(HazmatTunnel.D, hazTunnelEnc.getEnum(false, intsRef));
intsRef = em.createEdgeFlags();
readerWay = new ReaderWay(1);
readerWay.setTag("hazmat:adr_tunnel_cat", "E");
parser.handleWayTags(intsRef, readerWay, relFlags);
assertEquals(HazmatTunnel.E, hazTunnelEnc.getEnum(false, intsRef));
}
use of com.graphhopper.storage.IntsRef in project graphhopper by graphhopper.
the class OSMHazmatTunnelParserTest method testOrder.
@Test
public void testOrder() {
IntsRef intsRef = em.createEdgeFlags();
ReaderWay readerWay = new ReaderWay(1);
readerWay.setTag("tunnel", "yes");
readerWay.setTag("hazmat:A", "no");
readerWay.setTag("hazmat:B", "no");
readerWay.setTag("hazmat:C", "no");
readerWay.setTag("hazmat:D", "no");
readerWay.setTag("hazmat:E", "no");
parser.handleWayTags(intsRef, readerWay, relFlags);
assertEquals(HazmatTunnel.E, hazTunnelEnc.getEnum(false, intsRef));
intsRef = em.createEdgeFlags();
readerWay = new ReaderWay(1);
readerWay.setTag("tunnel", "yes");
readerWay.setTag("hazmat:A", "no");
readerWay.setTag("hazmat:B", "no");
readerWay.setTag("hazmat:C", "no");
parser.handleWayTags(intsRef, readerWay, relFlags);
assertEquals(HazmatTunnel.C, hazTunnelEnc.getEnum(false, intsRef));
intsRef = em.createEdgeFlags();
readerWay = new ReaderWay(1);
readerWay.setTag("tunnel", "yes");
readerWay.setTag("hazmat:B", "no");
readerWay.setTag("hazmat:E", "no");
parser.handleWayTags(intsRef, readerWay, relFlags);
assertEquals(HazmatTunnel.E, hazTunnelEnc.getEnum(false, intsRef));
}
use of com.graphhopper.storage.IntsRef in project graphhopper by graphhopper.
the class OSMLanesParserTest method notTagged.
@Test
void notTagged() {
ReaderWay readerWay = new ReaderWay(1);
IntsRef intsRef = em.createEdgeFlags();
parser.handleWayTags(intsRef, readerWay, em.createRelationFlags());
Assertions.assertEquals(1, em.getIntEncodedValue(Lanes.KEY).getInt(false, intsRef));
}
use of com.graphhopper.storage.IntsRef in project graphhopper by graphhopper.
the class OSMLanesParserTest method basic.
@Test
void basic() {
ReaderWay readerWay = new ReaderWay(1);
IntsRef intsRef = em.createEdgeFlags();
readerWay.setTag("lanes", "4");
parser.handleWayTags(intsRef, readerWay, em.createRelationFlags());
Assertions.assertEquals(4, em.getIntEncodedValue(Lanes.KEY).getInt(false, intsRef));
}
Aggregations