Changeset 6515 in josm
- Timestamp:
- 2013-12-23T18:52:41+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data/validation
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/OsmValidator.java
r6506 r6515 99 99 UnclosedWays.class, // ID 1101 .. 1199 100 100 TagChecker.class, // ID 1201 .. 1299 101 UnconnectedWays.class, // ID 1301 .. 1399 101 UnconnectedWays.UnconnectedHighways.class, // ID 1301 .. 1399 102 UnconnectedWays.UnconnectedRailways.class, // ID 1301 .. 1399 103 UnconnectedWays.UnconnectedWaterways.class, // ID 1301 .. 1399 104 UnconnectedWays.UnconnectedNaturalOrLanduse.class, // ID 1301 .. 1399 105 UnconnectedWays.UnconnectedPower.class, // ID 1301 .. 1399 102 106 DuplicateWay.class, // ID 1401 .. 1499 103 107 NameMismatch.class, // ID 1501 .. 1599 -
trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java
r6494 r6515 22 22 import org.openstreetmap.josm.data.osm.BBox; 23 23 import org.openstreetmap.josm.data.osm.Node; 24 import org.openstreetmap.josm.data.osm.OsmPrimitive; 24 25 import org.openstreetmap.josm.data.osm.OsmUtils; 25 26 import org.openstreetmap.josm.data.osm.QuadBuckets; … … 32 33 33 34 /** 34 * Tests if there are segments that crosses in the same layer 35 * Tests if there are segments that crosses in the same layer. 36 * <br/> 37 * This class is abstract since highway/railway/waterway/… ways must be handled separately. 38 * An actual implementation must override {@link #isPrimitiveUsable(OsmPrimitive)} 39 * to denote which kind of primitives can be handled. 35 40 * 36 41 * @author frsantos 37 42 */ 38 public class UnconnectedWays extends Test { 43 public abstract class UnconnectedWays extends Test { 44 45 public static class UnconnectedHighways extends UnconnectedWays { 46 47 @Override 48 public boolean isPrimitiveUsable(OsmPrimitive p) { 49 return super.isPrimitiveUsable(p) && p.hasKey("highway"); 50 } 51 } 52 53 public static class UnconnectedRailways extends UnconnectedWays { 54 55 @Override 56 public boolean isPrimitiveUsable(OsmPrimitive p) { 57 return super.isPrimitiveUsable(p) && p.hasKey("railway"); 58 } 59 } 60 61 public static class UnconnectedWaterways extends UnconnectedWays { 62 63 @Override 64 public boolean isPrimitiveUsable(OsmPrimitive p) { 65 return super.isPrimitiveUsable(p) && p.hasKey("waterway"); 66 } 67 } 68 69 public static class UnconnectedNaturalOrLanduse extends UnconnectedWays { 70 71 @Override 72 public boolean isPrimitiveUsable(OsmPrimitive p) { 73 return super.isPrimitiveUsable(p) && (p.hasKey("natural") || p.hasKey("landuse")); 74 } 75 } 76 77 public static class UnconnectedPower extends UnconnectedWays { 78 79 @Override 80 public boolean isPrimitiveUsable(OsmPrimitive p) { 81 return super.isPrimitiveUsable(p) && p.hasKey("power"); 82 } 83 } 39 84 40 85 protected static final int UNCONNECTED_WAYS = 1301; … … 343 388 } 344 389 345 @Override346 public void visit(Node n) {347 }348 349 390 private void addNode(Node n, QuadBuckets<Node> s) { 350 391 boolean m = middlenodes.contains(n);
Note:
See TracChangeset
for help on using the changeset viewer.