Ticket #19869: 19869.patch

File 19869.patch, 1021 bytes (added by GerdP, 6 years ago)

avoid to create way in sharp angles test

  • src/org/openstreetmap/josm/data/validation/tests/SharpAngles.java

     
    104104    private void processSharpAngleForErrorCreation(double angle, int i, Way way, boolean last, Node pointNode) {
    105105        WaySegment ws1 = new WaySegment(way, i);
    106106        WaySegment ws2 = new WaySegment(way, last ? 0 : i + 1);
    107         double shorterLen = Math.min(ws1.toWay().getLength(), ws2.toWay().getLength());
     107        double d1 = ws1.getFirstNode().getEastNorth().distance(ws1.getSecondNode().getEastNorth());
     108        double d2 = ws2.getFirstNode().getEastNorth().distance(ws2.getSecondNode().getEastNorth());
     109        double shorterLen = Math.min(d1, d2);
    108110        if (shorterLen < maxLength) {
    109111            createNearlyOverlappingError(angle, way, pointNode);
    110112        }