Ticket #12493: 12493_v1.patch
File 12493_v1.patch, 2.5 KB (added by , 3 years ago) |
---|
-
src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java
20 20 import java.util.Objects; 21 21 import java.util.Set; 22 22 import java.util.stream.Collectors; 23 import java.util.stream.Stream; 23 24 24 25 import org.openstreetmap.josm.data.coor.EastNorth; 25 26 import org.openstreetmap.josm.data.coor.LatLon; … … 57 58 58 59 static final double DETOUR_FACTOR = 4; 59 60 61 private final Set<String> priorityHighwayTags = Stream.of("MOTORWAY", "MOTORWAY_LINK", "TRUNK", "TRUNK_LINK", "PRIMARY", 62 "PRIMARY_LINK", "SECONDARY", "SECONDARY_LINK", "TERTIARY", "TERTIARY_LINK", "RESIDENTIAL", "UNCLASSIFIED") 63 .collect(Collectors.toCollection(HashSet::new)); 64 60 65 protected abstract boolean isCandidate(OsmPrimitive p); 61 66 62 67 protected boolean isWantedWay(Way w) { … … 349 354 for (Entry<Node, MyWaySegment> error : errorMap.entrySet()) { 350 355 Node node = error.getKey(); 351 356 MyWaySegment ws = error.getValue(); 357 358 // Get parent way from nearby end node and extract highway tag. 359 Way parentWay = getWantedParentWay(node); 360 String parentWayHighwayTag = parentWay.get(HIGHWAY); 361 362 // Check if highway tag is Unclassified or above (Residential - Motorway) 363 // New message for warning categories. 364 // #12493 - Categorize 'Way end node near other highway' warnings. 365 if (priorityHighwayTags.contains(parentWayHighwayTag.toUpperCase())) { 366 message = tr("Way end node near other highway - Major"); 367 } 352 368 errors.add(TestError.builder(this, severity, code) 353 369 .message(message) 354 370 .primitives(node, ws.w) … … 373 389 if (!searchNodes.isEmpty()) { 374 390 maxLen = DETOUR_FACTOR * mindist; 375 391 if (isHighwayTest) { 376 addErrors(Severity.WARNING, getHighwayEndNodesNearOtherHighway(), tr("Way end node near other highway "));392 addErrors(Severity.WARNING, getHighwayEndNodesNearOtherHighway(), tr("Way end node near other highway - Minor")); 377 393 } else { 378 394 addErrors(Severity.WARNING, getWayEndNodesNearOtherWay(), tr("Way end node near other way")); 379 395 }