Changeset 18237 in josm
- Timestamp:
- 2021-09-30T01:35:56+02:00 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/data/gpx/GpxImageCorrelation.java
r18211 r18237 273 273 // This code gives a simple linear interpolation of the coordinates between current and 274 274 // previous track point assuming a constant speed in between 275 LatLon nextCoorForDirection = nextWp != null ? nextWp.getCoor() : null; 275 276 while (i >= 0) { 276 277 final GpxImageEntry curImg = images.get(i); 277 final GpxImageEntry curTmp = curImg.getTmp();278 278 final long imgTime = curImg.getExifInstant().toEpochMilli(); 279 279 if (imgTime < prevWpTime) { 280 280 break; 281 281 } 282 final GpxImageEntry curTmp = curImg.getTmp(); 282 283 if (!curTmp.hasNewGpsData()) { 283 284 // The values of timeDiff are between 0 and 1, it is not seconds but a dimensionless variable … … 287 288 final LatLon curCoor = curWp.getCoor(); 288 289 LatLon position = prevCoor.interpolate(curCoor, timeDiff); 289 if (next Wp!= null && (shiftXY || dirpos.isSetImageDirection())) {290 double direction = curCoor.bearing(nextWp.getCoor());290 if (nextCoorForDirection != null && (shiftXY || dirpos.isSetImageDirection())) { 291 double direction = position.bearing(nextCoorForDirection); 291 292 if (dirpos.isSetImageDirection()) { 292 293 curTmp.setExifImgDir(computeDirection(direction, dirpos.getImageDirectionAngleOffset())); … … 311 312 curImg.tmpUpdated(); 312 313 314 nextCoorForDirection = curCoor; 313 315 ret++; 314 316 }
Note:
See TracChangeset
for help on using the changeset viewer.