Changeset 4048 in josm
- Timestamp:
- 2011-04-20T15:43:21+02:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/CrossingWays.java
r3671 r4048 67 67 return; 68 68 69 String coastline1 = w.get("natural"); 70 boolean isCoastline1 = "water".equals(coastline1) || "coastline".equals(coastline1); 69 String natural1 = w.get("natural"); 70 String landuse1 = w.get("landuse"); 71 boolean isCoastline1 = "water".equals(natural1) || "coastline".equals(natural1) || "reservoir".equals(landuse1); 71 72 String railway1 = w.get("railway"); 72 73 boolean isSubway1 = "subway".equals(railway1); … … 80 81 81 82 String layer1 = w.get("layer"); 83 if ("0".equals(layer1)) layer1 = null; //0 is default value 82 84 83 85 int nodesSize = w.getNodesCount(); 84 86 for (int i = 0; i < nodesSize - 1; i++) { 85 87 WaySegment ws = new WaySegment(w, i); 86 ExtendedSegment es1 = new ExtendedSegment(ws, layer1, railway1, coastline1);88 ExtendedSegment es1 = new ExtendedSegment(ws, layer1, railway1, isCoastline1); 87 89 List<List<ExtendedSegment>> cellSegments = getSegments(es1.n1, es1.n2); 88 90 for (List<ExtendedSegment> segments : cellSegments) { … … 96 98 String layer2 = es2.layer; 97 99 String railway2 = es2.railway; 98 String coastline2 = es2.coastline;100 boolean isCoastline2 = es2.coastline; 99 101 if (layer1 == null ? layer2 != null : !layer1.equals(layer2)) 100 102 continue; … … 104 106 if (isTram1 && "tram".equals(railway2)) continue; 105 107 106 boolean isCoastline2 = coastline2 != null && (coastline2.equals("water") || coastline2.equals("coastline"));107 108 if (isCoastline1 != isCoastline2) continue; 108 109 … … 170 171 171 172 /** The coastline type */ 172 public Stringcoastline;173 public boolean coastline; 173 174 174 175 /** … … 177 178 * @param layer The layer of the way this segment is in 178 179 * @param railway The railway type of the way this segment is in 179 * @param coastline The coastline typoof the way the segment is in180 * @param coastline The coastline flag of the way the segment is in 180 181 */ 181 public ExtendedSegment(WaySegment ws, String layer, String railway, Stringcoastline) {182 public ExtendedSegment(WaySegment ws, String layer, String railway, boolean coastline) { 182 183 this.ws = ws; 183 184 this.n1 = ws.way.getNodes().get(ws.lowerIndex);
Note:
See TracChangeset
for help on using the changeset viewer.