Search in sources :

Example 1 with IntEncodedValue

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);
}
Also used : EncodingManager(com.graphhopper.routing.util.EncodingManager) IntsRef(com.graphhopper.storage.IntsRef) ReaderWay(com.graphhopper.reader.ReaderWay) IntEncodedValue(com.graphhopper.routing.ev.IntEncodedValue)

Aggregations

ReaderWay (com.graphhopper.reader.ReaderWay)1 IntEncodedValue (com.graphhopper.routing.ev.IntEncodedValue)1 EncodingManager (com.graphhopper.routing.util.EncodingManager)1 IntsRef (com.graphhopper.storage.IntsRef)1