- Timestamp:
- 2014-02-19T00:23:48+01:00 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/OverlappingWays.java
r6870 r6872 22 22 import org.openstreetmap.josm.data.osm.Way; 23 23 import org.openstreetmap.josm.data.osm.WaySegment; 24 import org.openstreetmap.josm.data.preferences.CollectionProperty; 24 25 import org.openstreetmap.josm.data.validation.Severity; 25 26 import org.openstreetmap.josm.data.validation.Test; … … 32 33 33 34 /** 34 * Tests if there are overlapping ways 35 * Tests if there are overlapping ways. 35 36 * 36 37 * @author frsantos … … 49 50 protected static final int OVERLAPPING_AREA = 120; 50 51 protected static final int DUPLICATE_WAY_SEGMENT = 121; 52 53 protected static final CollectionProperty IGNORED_KEYS = new CollectionProperty( 54 "overlapping-ways.ignored-keys", Arrays.asList("barrier", "building")); 51 55 52 56 /** Constructor */ … … 154 158 // see ticket #9598 - only report if at least 3 segments are shared 155 159 for (TestError error : preliminaryErrors) { 156 if (error.getHighlighted().size() / error.getPrimitives().size() >= 3 157 && !Utils.exists(error.getPrimitives(), Predicates.hasKey("building"))) { 158 errors.add(error); 160 if (error.getHighlighted().size() / error.getPrimitives().size() >= 3) { 161 boolean ignore = false; 162 for (String ignoredKey : IGNORED_KEYS.get()) { 163 if (Utils.exists(error.getPrimitives(), Predicates.hasKey(ignoredKey))) { 164 ignore = true; 165 break; 166 } 167 } 168 if (!ignore) { 169 errors.add(error); 170 } 159 171 } 160 172 }
Note:
See TracChangeset
for help on using the changeset viewer.