Changeset 6294 in josm
- Timestamp:
- 2013-10-04T00:57:06+02:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java
r6240 r6294 71 71 String landuse1 = w.get("landuse"); 72 72 boolean isCoastline1 = "water".equals(natural1) || "coastline".equals(natural1) || "reservoir".equals(landuse1); 73 String highway1 = w.get("highway"); 73 74 String railway1 = w.get("railway"); 74 75 boolean isSubway1 = "subway".equals(railway1); … … 90 91 for (int i = 0; i < nodesSize - 1; i++) { 91 92 WaySegment ws = new WaySegment(w, i); 92 ExtendedSegment es1 = new ExtendedSegment(ws, layer1, railway1, isCoastline1, waterway1);93 ExtendedSegment es1 = new ExtendedSegment(ws, layer1, highway1, railway1, isCoastline1, waterway1); 93 94 for (List<ExtendedSegment> segments : getSegments(es1.n1, es1.n2)) { 94 95 for (ExtendedSegment es2 : segments) { … … 101 102 102 103 String layer2 = es2.layer; 104 String highway2 = es2.highway; 103 105 String railway2 = es2.railway; 104 106 boolean isCoastline2 = es2.coastline; … … 125 127 } 126 128 127 if (("abandoned".equals(es1.railway)) || ("abandoned".equals(railway2))) { 129 if ("proposed".equals(es1.highway) || "proposed".equals(highway2) 130 || "abandoned".equals(es1.railway) || "abandoned".equals(railway2)) { 128 131 continue; 129 132 } … … 140 143 } else if ((es1.waterway != null && es2.waterway != null)) { 141 144 message = tr("Crossing waterways"); 142 } else if ((es1.waterway != null && es2. ws.way.get("highway")!= null)143 || (es2.waterway != null && es1. ws.way.get("highway")!= null)) {145 } else if ((es1.waterway != null && es2.highway != null) 146 || (es2.waterway != null && es1.highway != null)) { 144 147 message = tr("Crossing waterway/highway"); 145 148 } else { … … 189 192 */ 190 193 public static class ExtendedSegment { 191 private Node n1, n2;192 193 private WaySegment ws;194 private final Node n1, n2; 195 196 private final WaySegment ws; 194 197 195 198 /** The layer */ 196 private String layer; 199 private final String layer; 200 201 /** The highway type */ 202 private final String highway; 197 203 198 204 /** The railway type */ 199 private String railway;205 private final String railway; 200 206 201 207 /** The waterway type */ 202 private String waterway;208 private final String waterway; 203 209 204 210 /** The coastline type */ 205 private boolean coastline;211 private final boolean coastline; 206 212 207 213 /** … … 209 215 * @param ws The way segment 210 216 * @param layer The layer of the way this segment is in 217 * @param highway The highway type of the way this segment is in 211 218 * @param railway The railway type of the way this segment is in 212 219 * @param coastline The coastline flag of the way the segment is in 213 220 * @param waterway The waterway type of the way this segment is in 214 221 */ 215 public ExtendedSegment(WaySegment ws, String layer, String railway, boolean coastline, String waterway) {222 public ExtendedSegment(WaySegment ws, String layer, String highway, String railway, boolean coastline, String waterway) { 216 223 this.ws = ws; 217 224 this.n1 = ws.way.getNodes().get(ws.lowerIndex); 218 225 this.n2 = ws.way.getNodes().get(ws.lowerIndex + 1); 219 226 this.layer = layer; 227 this.highway = highway; 220 228 this.railway = railway; 221 229 this.coastline = coastline;
Note:
See TracChangeset
for help on using the changeset viewer.