Ticket #12493: 12493-2.patch
File 12493-2.patch, 2.1 KB (added by , 3 years ago) |
---|
-
src/org/openstreetmap/josm/data/validation/tests/UnconnectedWays.java
57 57 58 58 static final double DETOUR_FACTOR = 4; 59 59 60 private final Set<String> priorityHighwayTags = new HashSet<>(Highways.CLASSIFIED_HIGHWAYS); 61 60 62 protected abstract boolean isCandidate(OsmPrimitive p); 61 63 62 64 protected boolean isWantedWay(Way w) { … … 368 370 for (Entry<Node, MyWaySegment> error : errorMap.entrySet()) { 369 371 Node node = error.getKey(); 370 372 MyWaySegment ws = error.getValue(); 373 String usedMsg = message; 374 // #12493 - Categorize 'Way end node near other highway' warnings. 375 if (isHighwayTest && priorityHighwayTags.contains(ws.w.get(HIGHWAY))) { 376 // Get parent way from nearby end node and extract highway tag. 377 Way parentWay = getWantedParentWay(node); 378 if (priorityHighwayTags.contains(parentWay.get(HIGHWAY))) { 379 // both ways are major, change message 380 usedMsg = tr("Way end node near other highway - Major"); 381 } 382 } 371 383 errors.add(TestError.builder(this, severity, code) 372 .message( message)384 .message(usedMsg) 373 385 .primitives(node, ws.w) 374 386 .highlight(node) 375 387 .build()); … … 392 404 if (!searchNodes.isEmpty()) { 393 405 maxLen = DETOUR_FACTOR * mindist; 394 406 if (isHighwayTest) { 395 addErrors(Severity.WARNING, getHighwayEndNodesNearOtherHighway(), tr("Way end node near other highway "));407 addErrors(Severity.WARNING, getHighwayEndNodesNearOtherHighway(), tr("Way end node near other highway - Minor")); 396 408 } else { 397 409 addErrors(Severity.WARNING, getWayEndNodesNearOtherWay(), tr("Way end node near other way")); 398 410 }