Esempio n. 1
0
 @Override
 public void visit(Way w) {
   if (w.getNodesCount() > 0 // do not consider empty ways
       && !w.hasKey(
           "addr:interpolation") // ignore addr:interpolation ways as they are not physical
                                 // features and most of
       // the time very near the associated highway, which is perfectly normal, see #9332
       && !w.hasTag("highway", "platform")
       && !w.hasTag("railway", "platform") // similarly for public transport platforms
   ) {
     ways.addAll(getWaySegments(w));
     QuadBuckets<Node> set = endnodes;
     if (w.hasKey("highway") || w.hasKey("railway")) {
       set = endnodesHighway;
     }
     addNode(w.firstNode(), set);
     addNode(w.lastNode(), set);
   }
 }
Esempio n. 2
0
 @Override
 public void visit(Node n) {
   List<Relation> associatedStreets = getAndCheckAssociatedStreets(n);
   // Find house number without proper location (neither addr:street, associatedStreet, addr:place
   // or addr:interpolation)
   if (n.hasKey(ADDR_HOUSE_NUMBER) && !n.hasKey(ADDR_STREET) && !n.hasKey(ADDR_PLACE)) {
     for (Relation r : associatedStreets) {
       if (r.hasTag("type", ASSOCIATED_STREET)) {
         return;
       }
     }
     for (Way w : OsmPrimitive.getFilteredList(n.getReferrers(), Way.class)) {
       if (w.hasKey(ADDR_INTERPOLATION) && w.hasKey(ADDR_STREET)) {
         return;
       }
     }
     // No street found
     errors.add(
         new AddressError(HOUSE_NUMBER_WITHOUT_STREET, n, tr("House number without street")));
   }
 }
  @Override
  public void visit(Way w) {
    assert aNode != null;

    if (w.hasKey(tag)) {
      double dist = OsmUtils.getMinimumDistanceToWay(aNode.getCoor(), w);
      if (dist < minDist && dist < maxDist) {
        minDist = dist;
        currentValue = w.get(tag);
        srcNode = w;
      }
    }
  }
Esempio n. 4
0
  List<MyWaySegment> getWaySegments(Way w) {
    List<MyWaySegment> ret = new ArrayList<>();
    if (!w.isUsable() || w.hasKey("barrier") || w.hasTag("natural", "cliff")) return ret;

    int size = w.getNodesCount();
    if (size < 2) return ret;
    for (int i = 1; i < size; ++i) {
      if (i < size - 1) {
        addNode(w.getNode(i), middlenodes);
      }
      Node a = w.getNode(i - 1);
      Node b = w.getNode(i);
      if (a.isDrawable() && b.isDrawable()) {
        MyWaySegment ws = new MyWaySegment(w, a, b);
        if (ws.isBoundary || ws.isAbandoned) {
          continue;
        }
        ret.add(ws);
      }
    }
    return ret;
  }