Ticket #21334: 0001-Point-to-the-next-Waypoint.patch

File 0001-Point-to-the-next-Waypoint.patch, 1.7 KB (added by StephaneP, 9 months ago)

fix direction

  • src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java

     src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java | 5 ++++-
     1 file changed, 4 insertions(+), 1 deletion(-)
    
    diff --git a/src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java b/src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java
    index 1750d76d0..d9591aa12 100644
    a b public final class GpxImageCorrelation {  
    286286            // This code gives a simple linear interpolation of the coordinates between current and
    287287            // previous track point assuming a constant speed in between
    288288            @SuppressWarnings("null")
    289             LatLon nextCoorForDirection = nextWp.getCoor();
     289            LatLon nextCoorForDirection = curWp.getCoor();
    290290            while (i >= 0) {
    291291                final GpxImageEntry curImg = images.get(i);
    292292                final long imgTime = curImg.getExifInstant().toEpochMilli();
    public final class GpxImageCorrelation {  
    302302                    final LatLon curCoor = curWp.getCoor();
    303303                    LatLon position = prevCoor.interpolate(curCoor, timeDiff);
    304304                    if (nextCoorForDirection != null && (shiftXY || dirpos.isSetImageDirection())) {
     305                        if (nextCoorForDirection.equals(curCoor)) {
     306                            nextCoorForDirection = nextWp.getCoor();
     307                        }
    305308                        double direction = position.bearing((ILatLon) nextCoorForDirection);
    306309                        if (dirpos.isSetImageDirection()) {
    307310                            curTmp.setExifImgDir(computeDirection(direction, dirpos.getImageDirectionAngleOffset()));