Changeset 17100 in josm for trunk


Ignore:
Timestamp:
2020-10-07T19:55:22+02:00 (4 years ago)
Author:
GerdP
Message:

fix #19869: test SharpAngles cannot cope with read-only datasets.
Don't use WaySegment.toWay() to calculate segment length as it adds a parent Way to existing nodes

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/data/validation/tests/SharpAngles.java

    r16913 r17100  
    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);
Note: See TracChangeset for help on using the changeset viewer.