Exemplo n.º 1
0
  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();
  }
Exemplo n.º 2
0
 public void release() {
   if (allNodes != null) {
     allNodes.release();
   }
   if (allWays != null) {
     allWays.release();
   }
   if (allRelations != null) {
     allRelations.release();
   }
   sink.release();
 }
Exemplo n.º 3
0
 private void sendRelations() {
   ReleasableIterator<RelationContainer> relationIterator = allRelations.iterate();
   while (relationIterator.hasNext()) {
     sink.process(relationIterator.next());
   }
   relationIterator.release();
 }
Exemplo n.º 4
0
  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();
  }
Exemplo n.º 5
0
  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);
  }
Exemplo n.º 6
0
 public void process(WayContainer container) {
   allWays.add(container);
 }
Exemplo n.º 7
0
 public void process(NodeContainer container) {
   allNodes.add(container);
 }