- Timestamp:
- 2011-01-11T00:30:13+01:00 (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/validation/tests/DuplicateNode.java
r3781 r3784 85 85 protected static int DUPLICATE_NODE_MIXED = 2; 86 86 protected static int DUPLICATE_NODE_OTHER = 3; 87 protected static int DUPLICATE_NODE_UNCLOSED = 4; 87 88 protected static int DUPLICATE_NODE_BUILDING = 10; 88 89 protected static int DUPLICATE_NODE_BOUNDARY = 11; … … 155 156 if (mm.get(tagSet).size() > 1) { 156 157 158 boolean oneWayClosed = false; 159 157 160 for (String type: types) { 158 161 typeMap.put(type, false); … … 167 170 boolean typed = false; 168 171 Way w=(Way) sp; 172 oneWayClosed = oneWayClosed || w.isClosed(); 169 173 Map<String, String> keys = w.getKeys(); 170 174 for (String type: typeMap.keySet()) { … … 190 194 } 191 195 192 if (nbType>1) { 196 if (!oneWayClosed) { 197 String msg = marktr("Duplicate nodes in two un-closed ways"); 198 errors.add(new TestError( 199 parentTest, 200 Severity.WARNING, 201 tr("Duplicated nodes"), 202 tr(msg), 203 msg, 204 DUPLICATE_NODE_UNCLOSED, 205 mm.get(tagSet) 206 )); 207 } else if (nbType>1) { 193 208 String msg = marktr("Mixed type duplicated nodes"); 194 209 errors.add(new TestError( … … 384 399 @Override 385 400 public boolean isFixable(TestError testError) { 386 return (testError.getTester() instanceof DuplicateNode && testError.getSeverity() == Severity.ERROR); 401 if (!(testError.getTester() instanceof DuplicateNode)) return false; 402 // never merge nodes with different tags. 403 if (testError.getCode() == DUPLICATE_NODE) return false; 404 // never merge nodes from two different non-closed geometries 405 if (testError.getCode() == DUPLICATE_NODE_UNCLOSED) return false; 406 // everything else is ok to merge 407 return true; 387 408 } 388 409
Note:
See TracChangeset
for help on using the changeset viewer.