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; }
protected Map<Node, Way> getWayEndNodesNearOtherWay() { Map<Node, Way> map = new HashMap<>(); for (MyWaySegment s : ways) { if (isCanceled()) { map.clear(); return map; } for (Node en : s.nearbyNodes(mindist)) { if (en.isConnectedTo(s.w.getNodes(), 3 /* hops */, null)) { continue; } if (endnodesHighway.contains(en) && !s.highway && !s.w.concernsArea()) { map.put(en, s.w); } else if (endnodes.contains(en) && !s.w.concernsArea()) { map.put(en, s.w); } } } return map; }
protected Map<Node, Way> getWayNodesNearOtherWay() { Map<Node, Way> map = new HashMap<>(); for (MyWaySegment s : ways) { if (isCanceled()) { map.clear(); return map; } for (Node en : s.nearbyNodes(minmiddledist)) { if (en.isConnectedTo(s.w.getNodes(), 3 /* hops */, null)) { continue; } if (!middlenodes.contains(en)) { continue; } map.put(en, s.w); } } return map; }
private void addNode(Node n, QuadBuckets<Node> s) { boolean m = middlenodes.contains(n); boolean e = endnodes.contains(n); boolean eh = endnodesHighway.contains(n); boolean o = othernodes.contains(n); if (!m && !e && !o && !eh) { s.add(n); } else if (!o) { othernodes.add(n); if (e) { endnodes.remove(n); } else if (eh) { endnodesHighway.remove(n); } else { middlenodes.remove(n); } } }