use of com.graphhopper.storage.IntsRef in project graphhopper by graphhopper.
the class OSMMtbRatingParserTest method checkRating.
private void checkRating(int expectedRating, String scaleString) {
OSMMtbRatingParser parser = new OSMMtbRatingParser();
EncodingManager em = new EncodingManager.Builder().add(parser).build();
IntEncodedValue ev = em.getIntEncodedValue(MtbRating.KEY);
IntsRef edgeFlags = em.createEdgeFlags();
ReaderWay way = new ReaderWay(0);
if (scaleString != null)
way.setTag("mtb:scale", scaleString);
parser.handleWayTags(edgeFlags, way, em.createRelationFlags());
assertEquals(expectedRating, ev.getInt(false, edgeFlags), "unexpected rating for mtb:scale=" + scaleString);
}
use of com.graphhopper.storage.IntsRef in project graphhopper by graphhopper.
the class OSMRoadClassParserTest method testIgnore.
@Test
public void testIgnore() {
ReaderWay readerWay = new ReaderWay(1);
IntsRef edgeFlags = em.createEdgeFlags();
readerWay.setTag("route", "ferry");
parser.handleWayTags(edgeFlags, readerWay, relFlags);
assertEquals(RoadClass.OTHER, rcEnc.getEnum(false, edgeFlags));
}
use of com.graphhopper.storage.IntsRef in project graphhopper by graphhopper.
the class OSMRoadClassParserTest method testNoNPE.
@Test
public void testNoNPE() {
ReaderWay readerWay = new ReaderWay(1);
IntsRef edgeFlags = em.createEdgeFlags();
parser.handleWayTags(edgeFlags, readerWay, relFlags);
assertEquals(RoadClass.OTHER, rcEnc.getEnum(false, edgeFlags));
}
use of com.graphhopper.storage.IntsRef in project graphhopper by graphhopper.
the class OSMHazmatParserTest method testSimpleTags.
@Test
public void testSimpleTags() {
ReaderWay readerWay = new ReaderWay(1);
IntsRef intsRef = em.createEdgeFlags();
readerWay.setTag("hazmat", "no");
parser.handleWayTags(intsRef, readerWay, relFlags);
assertEquals(Hazmat.NO, hazEnc.getEnum(false, intsRef));
intsRef = em.createEdgeFlags();
readerWay.setTag("hazmat", "yes");
parser.handleWayTags(intsRef, readerWay, relFlags);
assertEquals(Hazmat.YES, hazEnc.getEnum(false, intsRef));
intsRef = em.createEdgeFlags();
readerWay.setTag("hazmat", "designated");
parser.handleWayTags(intsRef, readerWay, relFlags);
assertEquals(Hazmat.YES, hazEnc.getEnum(false, intsRef));
intsRef = em.createEdgeFlags();
readerWay.setTag("hazmat", "designated");
parser.handleWayTags(intsRef, readerWay, relFlags);
assertEquals(Hazmat.YES, hazEnc.getEnum(false, intsRef));
}
use of com.graphhopper.storage.IntsRef in project graphhopper by graphhopper.
the class OSMHazmatWaterParserTest method testNoNPE.
@Test
public void testNoNPE() {
ReaderWay readerWay = new ReaderWay(1);
IntsRef intsRef = em.createEdgeFlags();
parser.handleWayTags(intsRef, readerWay, relFlags);
assertEquals(HazmatWater.YES, hazWaterEnc.getEnum(false, intsRef));
}
Aggregations