Ticket #6102: UnconnectedWays.diff
File UnconnectedWays.diff, 3.6 KB (added by , 15 years ago) |
---|
-
src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java
59 59 */ 60 60 public UnconnectedWays() { 61 61 super(tr("Unconnected ways."), 62 tr("This test checks if a way has an endpoint very near to another way."));62 tr("This test checks if a way has an endpoint very near to another way.")); 63 63 } 64 64 65 65 @Override … … 70 70 endnodes_highway = new HashSet<Node>(); 71 71 middlenodes = new HashSet<Node>(); 72 72 othernodes = new HashSet<Node>(); 73 mindist = Main.pref.getDouble(PREFIX + ".node_way_distance", 10.0) /6378135.0;74 minmiddledist = Main.pref.getDouble(PREFIX + ".way_way_distance", 0.0) /6378135.0;73 mindist = Main.pref.getDouble(PREFIX + ".node_way_distance", 10.0); 74 minmiddledist = Main.pref.getDouble(PREFIX + ".way_way_distance", 0.0); 75 75 this.ds = Main.main.getCurrentDataSet(); 76 76 this.ds_area = ds.getDataSourceArea(); 77 77 } … … 98 98 continue; 99 99 } 100 100 if ("turning_circle".equals(en.get("highway")) 101 || "bus_stop".equals(en.get("highway"))102 || "buffer_stop".equals(en.get("railway"))103 || OsmUtils.isTrue(en.get("noexit"))104 || en.hasKey("barrier")) {101 || "bus_stop".equals(en.get("highway")) 102 || "buffer_stop".equals(en.get("railway")) 103 || OsmUtils.isTrue(en.get("noexit")) 104 || en.hasKey("barrier")) { 105 105 continue; 106 106 } 107 107 // There's a small false-positive here. Imagine an intersection … … 203 203 this.highway = (highway != null || railway != null) && !isAbandoned; 204 204 this.isBoundary = !this.highway && "administrative".equals(w.get("boundary")); 205 205 line = new Line2D.Double(n1.getEastNorth().east(), n1.getEastNorth().north(), 206 206 n2.getEastNorth().east(), n2.getEastNorth().north()); 207 207 len = line.getP1().distance(line.getP2()); 208 208 this.n1 = n1; 209 209 this.n2 = n2; … … 295 295 296 296 for (Node n : found_nodes) { 297 297 if (!nearby(n, dist) || 298 (ds_area != null && !ds_area.contains(n.getCoor()))) {298 (ds_area != null && !ds_area.contains(n.getCoor()))) { 299 299 continue; 300 300 } 301 301 // It is actually very rare for us to find a node … … 315 315 316 316 public boolean isArea() { 317 317 return w.hasKey("landuse") 318 319 320 318 || w.hasKey("leisure") 319 || w.hasKey("amenity") 320 || w.hasKey("building"); 321 321 } 322 322 } 323 323 324 324 List<MyWaySegment> getWaySegments(Way w) { 325 325 List<MyWaySegment> ret = new ArrayList<MyWaySegment>(); 326 326 if (!w.isUsable() 327 || w.hasKey("barrier")328 || "cliff".equals(w.get("natural")))327 || w.hasKey("barrier") 328 || "cliff".equals(w.get("natural"))) 329 329 return ret; 330 330 331 331 int size = w.getNodesCount();