Esempio n. 1
0
 protected Map<Node, Way> getWayEndNodesNearOtherHighway() {
   Map<Node, Way> map = new HashMap<>();
   for (int iter = 0; iter < 1; iter++) {
     for (MyWaySegment s : ways) {
       if (isCanceled()) {
         map.clear();
         return map;
       }
       for (Node en : s.nearbyNodes(mindist)) {
         if (en == null || !s.highway || !endnodesHighway.contains(en)) {
           continue;
         }
         if (en.hasTag("highway", "turning_circle", "bus_stop")
             || en.hasTag("amenity", "parking_entrance")
             || en.hasTag("railway", "buffer_stop")
             || en.isKeyTrue("noexit")
             || en.hasKey("entrance")
             || en.hasKey("barrier")) {
           continue;
         }
         // to handle intersections of 't' shapes and similar
         if (en.isConnectedTo(s.w.getNodes(), 3 /* hops */, null)) {
           continue;
         }
         map.put(en, s.w);
       }
     }
   }
   return map;
 }
Esempio n. 2
0
 public boolean nearby(Node n, double dist) {
   if (w == null) {
     Main.debug("way null");
     return false;
   }
   if (w.containsNode(n)) return false;
   if (n.isKeyTrue("noexit")) return false;
   EastNorth coord = n.getEastNorth();
   if (coord == null) return false;
   Point2D p = new Point2D.Double(coord.east(), coord.north());
   if (line.getP1().distance(p) > len + dist) return false;
   if (line.getP2().distance(p) > len + dist) return false;
   return line.ptSegDist(p) < dist;
 }