use of com.graphhopper.routing.ev.IntEncodedValue 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);
}
Aggregations