private void sendNodes() { // mark all nodes as required ReleasableIterator<WayContainer> wayIterator = allWays.iterate(); while (wayIterator.hasNext()) { Way way = wayIterator.next().getEntity(); if (!isRequiredWay(way)) continue; for (WayNode nodeReference : way.getWayNodes()) { long nodeId = nodeReference.getNodeId(); requiredNodes.set(nodeId); } } wayIterator.release(); ReleasableIterator<NodeContainer> nodeIterator = allNodes.iterate(); while (nodeIterator.hasNext()) { NodeContainer nodeContainer = nodeIterator.next(); if (!isRequiredNode(nodeContainer.getEntity())) { continue; } sink.process(nodeContainer); } nodeIterator.release(); }
public void release() { if (allNodes != null) { allNodes.release(); } if (allWays != null) { allWays.release(); } if (allRelations != null) { allRelations.release(); } sink.release(); }
private void sendRelations() { ReleasableIterator<RelationContainer> relationIterator = allRelations.iterate(); while (relationIterator.hasNext()) { sink.process(relationIterator.next()); } relationIterator.release(); }
private void sendWays() { ReleasableIterator<WayContainer> wayIterator = allWays.iterate(); while (wayIterator.hasNext()) { WayContainer wayContainer = wayIterator.next(); if (!isRequiredWay(wayContainer.getEntity())) continue; sink.process(wayContainer); } wayIterator.release(); }
public void process(RelationContainer container) { for (RelationMember member : container.getEntity().getMembers()) { EntityType memberType = member.getMemberType(); if (memberType.equals(EntityType.Way)) { requiredWays.set(member.getMemberId()); } else if (memberType.equals(EntityType.Node)) { requiredNodes.set(member.getMemberId()); } } allRelations.add(container); }
public void process(WayContainer container) { allWays.add(container); }
public void process(NodeContainer container) { allNodes.add(container); }