use of de.topobyte.osm4j.core.access.OsmIteratorInput in project osm4j-core by topobyte.
the class TestNodeIterator method test.
@Test
public void test() throws IOException {
InMemoryListDataSet data = ListDataSetLoader.read(createInput().createIterator(true, true), true, true, true);
OsmIteratorInput input = createInput().createIterator(true, true);
NodeIterator nodeIterator = new NodeIterator(input.getIterator());
List<OsmNode> nodes = Lists.newArrayList(nodeIterator.iterator());
input.close();
assertEquals(data.getNodes().size(), nodes.size());
for (int i = 0; i < nodes.size(); i++) {
OsmNode a = nodes.get(i);
OsmNode b = data.getNodes().get(i);
assertTrue(EqualityUtil.equals(a, b));
}
}
use of de.topobyte.osm4j.core.access.OsmIteratorInput in project osm4j-core by topobyte.
the class TestRelationIterator method test.
@Test
public void test() throws IOException {
InMemoryListDataSet data = ListDataSetLoader.read(createInput().createIterator(true, true), true, true, true);
OsmIteratorInput input = createInput().createIterator(true, true);
RelationIterator relationIterator = new RelationIterator(input.getIterator());
List<OsmRelation> relations = Lists.newArrayList(relationIterator.iterator());
input.close();
assertEquals(data.getRelations().size(), relations.size());
for (int i = 0; i < relations.size(); i++) {
OsmRelation a = relations.get(i);
OsmRelation b = data.getRelations().get(i);
assertTrue(EqualityUtil.equals(a, b));
}
}
use of de.topobyte.osm4j.core.access.OsmIteratorInput in project osm4j-core by topobyte.
the class TestWayIterator method test.
@Test
public void test() throws IOException {
InMemoryListDataSet data = ListDataSetLoader.read(createInput().createIterator(true, true), true, true, true);
OsmIteratorInput input = createInput().createIterator(true, true);
WayIterator wayIterator = new WayIterator(input.getIterator());
List<OsmWay> ways = Lists.newArrayList(wayIterator.iterator());
input.close();
assertEquals(data.getWays().size(), ways.size());
for (int i = 0; i < ways.size(); i++) {
OsmWay a = ways.get(i);
OsmWay b = data.getWays().get(i);
assertTrue(EqualityUtil.equals(a, b));
}
}
Aggregations