Changeset 6392 in josm for trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageEntry.java
- Timestamp:
- 2013-11-18T03:05:56+01:00 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/gui/layer/geoimage/ImageEntry.java
r6296 r6392 18 18 private Double exifImgDir; 19 19 private Date exifTime; 20 /** 21 * Flag isNewGpsData indicates that the GPS data of the image is new or has changed. 22 * GPS data includes the position, speed, elevation, time (e.g. as extracted from the GPS track). 23 * The flag can used to decide for which image file the EXIF GPS data is (re-)written. 24 */ 25 private boolean isNewGpsData = false; 26 /** Temporary source of GPS time if not correlated with GPX track. */ 27 private Date exifGpsTime = null; 20 28 Image thumbnail; 21 29 22 /** The following values are computed from the correlation with the gpx track */ 30 /** 31 * The following values are computed from the correlation with the gpx track 32 * or extracted from the image EXIF data. 33 */ 23 34 private CachedLatLon pos; 24 35 /** Speed in kilometer per second */ … … 75 86 return exifTime; 76 87 } 88 89 /** 90 * Returns the EXIF GPS time. 91 * @return the EXIF GPS time 92 * @since 6392 93 */ 94 public final Date getExifGpsTime() { 95 return exifGpsTime; 96 } 97 77 98 public LatLon getExifCoor() { 78 99 return exifCoor; … … 110 131 this.exifTime = exifTime; 111 132 } 133 134 /** 135 * Sets the EXIF GPS time. 136 * @param exifGpsTime the EXIF GPS time 137 * @since 6392 138 */ 139 public final void setExifGpsTime(Date exifGpsTime) { 140 this.exifGpsTime = exifGpsTime; 141 } 142 112 143 public void setGpsTime(Date gpsTime) { 113 144 this.gpsTime = gpsTime; … … 184 215 return result; 185 216 } 217 218 /** 219 * Indicates that the image has new GPS data. 220 * That flag is used e.g. by the photo_geotagging plugin to decide for which image 221 * file the EXIF GPS data needs to be (re-)written. 222 * @since 6392 223 */ 224 public void flagNewGpsData() { 225 isNewGpsData = true; 226 // We need to set the GPS time to tell the system (mainly the photo_geotagging plug-in) 227 // that the GPS data has changed. Check for existing GPS time and take EXIF time otherwise. 228 // This can be removed once isNewGpsData is used instead of the GPS time. 229 if (gpsTime == null) { 230 Date gpsTime = getExifGpsTime(); 231 if (gpsTime == null) { 232 gpsTime = getExifTime(); 233 if (gpsTime == null) { 234 // Time still not set, take the current time. 235 gpsTime = new Date(); 236 } 237 } 238 setGpsTime(gpsTime); 239 } 240 if (tmp != null && tmp.getGpsTime() == null) { 241 // tmp.gpsTime overrides gpsTime, so we set it too. 242 tmp.setGpsTime(getGpsTime()); 243 } 244 } 245 246 /** 247 * Queries whether the GPS data changed. 248 * @return {@code true} if GPS data changed, {@code false} otherwise 249 * @since 6392 250 */ 251 public boolean hasNewGpsData() { 252 return isNewGpsData; 253 } 186 254 }
Note:
See TracChangeset
for help on using the changeset viewer.