use of de.topobyte.osm4j.core.model.iface.IdContainer in project osm4j-core by topobyte.
the class IdDataSetReader method read.
public static InMemorySetIdDataSet read(OsmIdIterator iterator) throws IOException {
InMemorySetIdDataSet dataSet = new InMemorySetIdDataSet();
TLongSet nodeIds = dataSet.getNodeIds();
TLongSet wayIds = dataSet.getWayIds();
TLongSet relationIds = dataSet.getRelationIds();
if (iterator.hasBounds()) {
dataSet.setBounds(iterator.getBounds());
}
while (iterator.hasNext()) {
IdContainer container = iterator.next();
switch(container.getType()) {
case Node:
nodeIds.add(container.getId());
break;
case Way:
wayIds.add(container.getId());
break;
case Relation:
relationIds.add(container.getId());
break;
}
}
return dataSet;
}
Aggregations