use of com.graphhopper.reader.ReaderRelation in project graphhopper by graphhopper.
the class OSMReaderTest method testRelation.
@Test
public void testRelation() {
EncodingManager manager = EncodingManager.create("bike");
ReaderRelation osmRel = new ReaderRelation(1);
osmRel.add(new ReaderRelation.Member(ReaderRelation.WAY, 1, ""));
osmRel.add(new ReaderRelation.Member(ReaderRelation.WAY, 2, ""));
osmRel.setTag("route", "bicycle");
osmRel.setTag("network", "lcn");
IntsRef flags = manager.createRelationFlags();
manager.handleRelationTags(osmRel, flags);
assertFalse(flags.isEmpty());
// unchanged network
IntsRef before = IntsRef.deepCopyOf(flags);
manager.handleRelationTags(osmRel, flags);
assertEquals(before, flags);
// overwrite network
osmRel.setTag("network", "ncn");
manager.handleRelationTags(osmRel, flags);
assertNotEquals(before, flags);
}
Aggregations