- Timestamp:
- 2013-12-18T16:04:13+01:00 (11 years ago)
- Location:
- trunk/src/org/openstreetmap/josm/data
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/osm/Node.java
r6380 r6491 331 331 this.north = Double.NaN; 332 332 } 333 334 @Override 335 public boolean concernsArea() { 336 // A node cannot be an area 337 return false; 338 } 333 339 } -
trunk/src/org/openstreetmap/josm/data/osm/OsmPrimitive.java
r6380 r6491 1312 1312 return ret; 1313 1313 } 1314 1315 /** 1316 * Determines if this primitive has tags denoting an area. 1317 * @return {@code true} if this primitive has tags denoting an area, {@code false} otherwise. 1318 * @since 6491 1319 */ 1320 public final boolean hasAreaTags() { 1321 return hasKey("landuse") 1322 || "yes".equals(get("area")) 1323 || "riverbank".equals(get("waterway")) 1324 || hasKey("natural") 1325 || hasKey("amenity") 1326 || hasKey("leisure") 1327 || hasKey("building") 1328 || hasKey("building:part"); 1329 } 1330 1331 /** 1332 * Determines if this primitive semantically concerns an area. 1333 * @return {@code true} if this primitive semantically concerns an area, according to its type, geometry and tags, {@code false} otherwise. 1334 * @since 6491 1335 */ 1336 public abstract boolean concernsArea(); 1314 1337 } -
trunk/src/org/openstreetmap/josm/data/osm/Relation.java
r6316 r6491 548 548 } 549 549 } 550 551 @Override 552 public boolean concernsArea() { 553 return isMultipolygon() && hasAreaTags(); 554 } 550 555 } -
trunk/src/org/openstreetmap/josm/data/osm/Way.java
r6380 r6491 6 6 import java.util.ArrayList; 7 7 import java.util.Arrays; 8 import java.util.HashSet; 8 9 import java.util.List; 9 10 import java.util.Set; 10 import java.util.HashSet;11 11 12 12 import org.openstreetmap.josm.Main; … … 721 721 return !respectOneway || isOneway() != -1 ? lastNode() : firstNode(); 722 722 } 723 724 @Override 725 public boolean concernsArea() { 726 return hasAreaTags(); 727 } 723 728 } -
trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java
r6304 r6491 55 55 } 56 56 57 private boolean concernsArea(OsmPrimitive p) {58 return p.get("landuse") != null59 || "riverbank".equals(p.get("waterway"))60 || p.get("natural") != null61 || p.get("amenity") != null62 || p.get("leisure") != null63 || p.get("building") != null64 || p.get("building:part") != null;65 }66 67 57 private boolean parentMultipolygonConcernsArea(OsmPrimitive p) { 68 58 for (Relation r : OsmPrimitive.getFilteredList(p.getReferrers(), Relation.class)) { 69 if (r. isMultipolygon() && concernsArea(r) ) {59 if (r.concernsArea() ) { 70 60 return true; 71 61 } … … 73 63 return false; 74 64 } 75 65 66 @SuppressWarnings("null") 76 67 @Override 77 68 public void endTest() { … … 99 90 area++; 100 91 } 101 if ( concernsArea(ws.way) || parentMultipolygonConcernsArea(ws.way)) {92 if (ws.way.concernsArea() || parentMultipolygonConcernsArea(ws.way)) { 102 93 area++; 103 94 ways--; -
trunk/src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java
r6393 r6491 112 112 return; 113 113 for (Node en : s.nearbyNodes(mindist)) { 114 if (endnodes_highway.contains(en) && !s.highway && !s. isArea()) {115 map.put(en, s.w); 116 } else if (endnodes.contains(en) && !s. isArea()) {114 if (endnodes_highway.contains(en) && !s.highway && !s.w.concernsArea()) { 115 map.put(en, s.w); 116 } else if (endnodes.contains(en) && !s.w.concernsArea()) { 117 117 map.put(en, s.w); 118 118 } … … 294 294 } 295 295 return nearbyNodeCache; 296 }297 298 public boolean isArea() {299 return w.hasKey("landuse")300 || w.hasKey("leisure")301 || w.hasKey("amenity")302 || w.hasKey("building");303 296 } 304 297 }
Note:
See TracChangeset
for help on using the changeset viewer.