Changeset 4073 in josm
- Timestamp:
- 2011-05-04T22:03:53+02:00 (14 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/validation/tests
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/Coastlines.java
r3698 r4073 14 14 import org.openstreetmap.josm.command.ChangeCommand; 15 15 import org.openstreetmap.josm.command.Command; 16 import org.openstreetmap.josm.data.osm.Node; 16 17 import org.openstreetmap.josm.data.osm.OsmPrimitive; 17 import org.openstreetmap.josm.data.osm.Node;18 18 import org.openstreetmap.josm.data.osm.Way; 19 19 import org.openstreetmap.josm.data.validation.Severity; … … 44 44 public Coastlines() { 45 45 super(tr("Coastlines."), 46 tr("This test checks that coastlines are correct."));46 tr("This test checks that coastlines are correct.")); 47 47 } 48 48 … … 67 67 Node tail = c1.lastNode(); 68 68 69 if ( head.equals(tail)) {69 if (c1.getNodesCount() == 0 || head.equals(tail)) { 70 70 continue; 71 71 } … … 162 162 if (highlight.size() > 0) { 163 163 errors.add(new TestError(this, Severity.ERROR, tr("Unconnected coastline"), 164 164 UNCONNECTED_COASTLINE, primitives, highlight)); 165 165 } 166 166 } … … 191 191 192 192 errors.add(new TestError(this, Severity.ERROR, tr("Unordered coastline"), 193 193 UNORDERED_COASTLINE, primitives, highlight)); 194 194 } 195 195 else if (reversed) { 196 196 errors.add(new TestError(this, Severity.ERROR, tr("Reversed coastline"), 197 197 REVERSED_COASTLINE, primitives)); 198 198 } 199 199 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java
r4059 r4073 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 … … 89 89 } 90 90 if ("turning_circle".equals(en.get("highway")) 91 || "bus_stop".equals(en.get("highway"))92 || "buffer_stop".equals(en.get("railway"))93 || OsmUtils.isTrue(en.get("noexit"))94 || en.hasKey("barrier")) {91 || "bus_stop".equals(en.get("highway")) 92 || "buffer_stop".equals(en.get("railway")) 93 || OsmUtils.isTrue(en.get("noexit")) 94 || en.hasKey("barrier")) { 95 95 continue; 96 96 } … … 198 198 this.isBoundary = !this.highway && "administrative".equals(w.get("boundary")); 199 199 line = new Line2D.Double(n1.getEastNorth().east(), n1.getEastNorth().north(), 200 200 n2.getEastNorth().east(), n2.getEastNorth().north()); 201 201 len = line.getP1().distance(line.getP2()); 202 202 this.n1 = n1; … … 288 288 found_nodes.addAll(endnodes.search(new BBox(bounds.get(0), bounds.get(1)))); 289 289 290 if (found_nodes == null)291 return Collections.emptySet();292 293 290 for (Node n : found_nodes) { 294 291 if (!nearby(n, dist) || 295 (ds_area != null && !ds_area.contains(n.getCoor()))) {292 (ds_area != null && !ds_area.contains(n.getCoor()))) { 296 293 continue; 297 294 } … … 313 310 public boolean isArea() { 314 311 return w.hasKey("landuse") 315 316 317 312 || w.hasKey("leisure") 313 || w.hasKey("amenity") 314 || w.hasKey("building"); 318 315 } 319 316 } … … 322 319 List<MyWaySegment> ret = new ArrayList<MyWaySegment>(); 323 320 if (!w.isUsable() 324 || w.hasKey("barrier")325 || "cliff".equals(w.get("natural")))321 || w.hasKey("barrier") 322 || "cliff".equals(w.get("natural"))) 326 323 return ret; 327 324 … … 344 341 @Override 345 342 public void visit(Way w) { 346 ways.addAll(getWaySegments(w)); 347 QuadBuckets<Node> set = endnodes; 348 if (w.hasKey("highway") || w.hasKey("railway")) { 349 set = endnodes_highway; 350 } 351 addNode(w.firstNode(), set); 352 addNode(w.lastNode(), set); 343 if (w.getNodesCount() > 0) { 344 ways.addAll(getWaySegments(w)); 345 QuadBuckets<Node> set = endnodes; 346 if (w.hasKey("highway") || w.hasKey("railway")) { 347 set = endnodes_highway; 348 } 349 addNode(w.firstNode(), set); 350 addNode(w.lastNode(), set); 351 } 353 352 } 354 353
Note:
See TracChangeset
for help on using the changeset viewer.