- Timestamp:
- 2012-11-01T21:07:40+01:00 (12 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/CrossingWays.java
r5293 r5550 42 42 */ 43 43 public CrossingWays() { 44 super(tr("Crossing ways "),44 super(tr("Crossing ways."), 45 45 tr("This test checks if two roads, railways, waterways or buildings crosses in the same layer, but are not connected by a node.")); 46 46 } … … 139 139 if (isBuilding) { 140 140 message = tr("Crossing buildings"); 141 } else if ((es1.waterway != null && es2.waterway != null)) { 142 message = tr("Crossing waterways"); 141 143 } else if ((es1.waterway != null && es2.ws.way.get("highway") != null) 142 144 || (es2.waterway != null && es1.ws.way.get("highway") != null)) { -
trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingAreas.java
r5490 r5550 3 3 import static org.openstreetmap.josm.tools.I18n.tr; 4 4 5 import java.util.ArrayList; 5 6 import java.util.Collection; 6 7 import java.util.Collections; … … 49 50 }); 50 51 if (!overlaps.isEmpty()) { 51 errors.add(new TestError(this, Severity.OTHER, tr("Overlapping Areas"), 52 OVERLAPPING_AREAS, Collections.singletonList(w), overlaps)); 52 Collection<Way> overlapsWater = new ArrayList<Way>(); 53 Collection<Way> overlapsOther = new ArrayList<Way>(); 54 55 String natural1 = w.get("natural"); 56 String landuse1 = w.get("landuse"); 57 boolean isWaterArea = "water".equals(natural1) || "wetland".equals(natural1) || "coastline".equals(natural1) || "reservoir".equals(landuse1); 58 boolean isWaterArea2 = false; 59 60 for (Way wayOther : overlaps) { 61 String natural2 = wayOther.get("natural"); 62 String landuse2 = wayOther.get("landuse"); 63 boolean isWaterAreaTest = "water".equals(natural2) || "wetland".equals(natural2) || "coastline".equals(natural2) || "reservoir".equals(landuse2); 64 65 if (!isWaterArea2) { 66 isWaterArea2 = isWaterAreaTest; 67 } 68 69 if (isWaterArea && isWaterAreaTest) { 70 overlapsWater.add(wayOther); 71 } else { 72 overlapsOther.add(wayOther); 73 } 74 } 75 76 if (!overlapsWater.isEmpty()) { 77 errors.add(new TestError(this, Severity.WARNING, tr("Overlapping Water Areas"), 78 OVERLAPPING_AREAS, Collections.singletonList(w), overlapsWater)); 79 } 80 81 if (!overlapsOther.isEmpty()) { 82 errors.add(new TestError(this, Severity.OTHER, tr("Overlapping Areas"), 83 OVERLAPPING_AREAS, Collections.singletonList(w), overlapsOther)); 84 } 53 85 } 54 86 }
Note:
See TracChangeset
for help on using the changeset viewer.