Package org.openstreetmap.josm.data.gpx
Class GpxImageEntry
java.lang.Object
org.openstreetmap.josm.data.gpx.GpxImageEntry
- All Implemented Interfaces:
Comparable<GpxImageEntry>,IQuadBucketType,ImageMetadata
- Direct Known Subclasses:
ImageEntry
public class GpxImageEntry
extends Object
implements Comparable<GpxImageEntry>, IQuadBucketType, ImageMetadata
Stores info about each image
- Since:
- 14205 (extracted from gui.layer.geoimage.ImageEntry)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Projectionsprivate DoubleElevation (altitude) in metersprivate LatLonprivate StringGPS Datumprivate Doubleprivate StringGPS processing methodprivate InstantTemporary source of GPS time if not correlated with GPX track.private Doubleprivate Doubleprivate Doubleprivate Integerprivate Instantprivate Fileprivate IntegerGPS Measure modeprivate IntegerGPS Differential modeprivate InstantThe time after correlation with a gpx trackprivate intprivate Stringprivate Stringprivate Stringprivate booleanFlag isNewGpsData indicates that the GPS data of the image is new or has changed.private CachedLatLonThe following values are computed from the correlation with the gpx track or extracted from the image EXIF data.private DoubleSpeed in kilometer per hourprivate GpxImageEntryWhen the correlation dialog is open, we like to show the image position for the current time offset on the map in real time.private int -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a newGpxImageEntry.GpxImageEntry(File file) Constructs a newGpxImageEntry.GpxImageEntry(GpxImageEntry other) Constructs a newGpxImageEntryfrom an existing instance. -
Method Summary
Modifier and TypeMethodDescriptionvoidapplyTmp()Copy the values from the temporary variable to the main instance.Returns aWayPointrepresentation of this GPX image entry.intcompareTo(GpxImageEntry image) Make a fresh copy and save it in the temporary variable.voidDelete the temporary variable.booleanvoidExtract GPS metadata from image EXIF.voidIndicates that the image has new GPS data.getBBox()Fetches the bounding box of the primitive.Returns a display name for this entryReturns the elevation value.Get the EXIF coordinatesReturn the EXIF GPS coordinates datum value.Return the GPS DOP value.Returns the EXIF GPS time.Return the EXIF GPS processing method stringConvenient way to determine if this entry has a EXIF GPS track angle value, without the cost of building a defensive copy.Convenient way to determine if this entry has a EXIF GPS horizontal positionning error value, without the cost of building a defensive copy.Get the EXIF directionReturns EXIF timeReturns EXIF orientationgetFile()Returns associated file.Return the GPS 2d or 3d mode value.Return the GPS Differential mode value.Returns the GPS time value.intReturns height of the image this GpxImageEntry represents.Get the image locationGet the image input streamReturns the IPTC caption.Returns the IPTC headline.Returns the IPTC keywords.Returns the IPTC object name.Get the last time the source was modified.getPos()Returns the position value.Get the projection type for this entrygetSpeed()Returns the speed value.getTimeSourceInstant(TimeSource timeSource) Return the time value selected with the parameter.getTmp()Get temporary variable that is used for real time parameter adjustments.intgetWidth()Returns width of the image this GpxImageEntry represents.booleanConvenient way to determine if this entry has a EXIF GPS time, without the cost of building a defensive copy.booleanConvenient way to determine if this entry has a EXIF time, without the cost of building a defensive copy.booleanConvenient way to determine if this entry has a GPS time, without the cost of building a defensive copy.inthashCode()booleanQueries whether the GPS data changed.booleanisTagged()If it has been tagged i.e.Reads the image represented by this entry in the given target dimension.voidsetElevation(Double elevation) Sets the elevation.voidsetExifCoor(ILatLon exifCoor) Sets the EXIF coordinatesvoidsetExifCoor(LatLon exifCoor) Sets the EXIF coordinate.voidsetExifGpsDatum(String exifGpsDatum) Sets the GPS Datum.voidsetExifGpsDop(Double exifGpsDop) Sets GPS DOP value.voidsetExifGpsProcMethod(String exifGpsProcMethod) Sets the GPS Processing Method.voidsetExifGpsTime(Instant exifGpsTime) Sets the EXIF GPS time.voidsetExifGpsTrack(Double exifGpsTrack) Sets the EXIF GPS track (move direction angle)voidsetExifHPosErr(Double exifHPosErr) Sets the EXIF horizontal positioning errorvoidsetExifImgDir(Double exifDir) Sets the EXIF directionvoidsetExifOrientation(Integer exifOrientation) Sets EXIF orientation.voidsetExifTime(Instant exifTime) Sets EXIF time.voidSets associated file.voidsetGps2d3dMode(Integer gps2d3dMode) Sets GPS 2d/3d mode.voidsetGpsDiffMode(Integer gpsDiffMode) Sets GPS Differential mode.voidsetGpsTime(Instant gpsTime) Sets the GPS time.voidsetHeight(int height) Sets the height of this GpxImageEntry.voidsetIptcCaption(String iptcCaption) Sets the IPTC caption.voidsetIptcHeadline(String iptcHeadline) Sets the IPTC headline.voidsetIptcKeywords(List<String> iptcKeywords) Sets the IPTC keywords.voidsetIptcObjectName(String iptcObjectName) Sets the IPTC object name.voidsetPos(CachedLatLon pos) Sets the position.voidSets the position.voidSets the position.voidsetProjectionType(Projections newProjection) Set the new projection typevoidSets the speed.voidsetWidth(int width) Sets the width of this GpxImageEntry.protected voidIndicate that the temporary copy has been updated.toString()String representation.voidRemove the flag that indicates new GPS data.
-
Field Details
-
file
-
exifOrientation
-
exifCoor
-
exifImgDir
-
exifGpsTrack
-
exifHPosErr
-
exifGpsDop
-
exifTime
-
cameraProjection
-
isNewGpsData
Flag isNewGpsData indicates that the GPS data of the image is new or has changed. GPS data includes the position, speed, elevation, time (e.g. as extracted from the GPS track). The flag can used to decide for which image file the EXIF GPS data is (re-)written. -
exifGpsTime
Temporary source of GPS time if not correlated with GPX track. -
iptcCaption
-
iptcHeadline
-
iptcKeywords
-
iptcObjectName
-
pos
The following values are computed from the correlation with the gpx track or extracted from the image EXIF data. -
speed
Speed in kilometer per hour -
elevation
Elevation (altitude) in meters -
gpsDiffMode
GPS Differential mode -
gps2d3dMode
GPS Measure mode -
exifGpsDatum
GPS Datum -
exifGpsProcMethod
GPS processing method -
gpsTime
The time after correlation with a gpx track -
width
-
height
-
tmp
When the correlation dialog is open, we like to show the image position for the current time offset on the map in real time. On the other hand, when the user aborts this operation, the old values should be restored. We have a temporary copy, that overrides the normal values if it is not null. (This may be not the most elegant solution for this, but it works.)
-
-
Constructor Details
-
GpxImageEntry
public GpxImageEntry()Constructs a newGpxImageEntry. -
GpxImageEntry
Constructs a newGpxImageEntryfrom an existing instance.- Parameters:
other- existing instance- Since:
- 14624
-
GpxImageEntry
Constructs a newGpxImageEntry.- Parameters:
file- Path to image file on disk
-
-
Method Details
-
getImageURI
Description copied from interface:ImageMetadataGet the image location- Specified by:
getImageURIin interfaceImageMetadata- Returns:
- The image location
-
getWidth
Returns width of the image this GpxImageEntry represents.- Specified by:
getWidthin interfaceImageMetadata- Returns:
- width of the image this GpxImageEntry represents
- Since:
- 13220
-
getHeight
Returns height of the image this GpxImageEntry represents.- Specified by:
getHeightin interfaceImageMetadata- Returns:
- height of the image this GpxImageEntry represents
- Since:
- 13220
-
getPos
Returns the position value. The position value from the temporary copy is returned if that copy exists.- Specified by:
getPosin interfaceImageMetadata- Returns:
- the position value
-
getSpeed
Returns the speed value. The speed value from the temporary copy is returned if that copy exists.- Specified by:
getSpeedin interfaceImageMetadata- Returns:
- the speed value
-
getElevation
Returns the elevation value. The elevation value from the temporary copy is returned if that copy exists.- Specified by:
getElevationin interfaceImageMetadata- Returns:
- the elevation value
-
getGpsDiffMode
Return the GPS Differential mode value. The GPS Differential mode value from the temporary copy is returned if that copy exists.- Specified by:
getGpsDiffModein interfaceImageMetadata- Returns:
- the differential mode value
- Since:
- 19387
-
getGps2d3dMode
Return the GPS 2d or 3d mode value. The GPS mode value form the temporary copy is returned if that copy exists.- Specified by:
getGps2d3dModein interfaceImageMetadata- Returns:
- the GPS 2d/3d mode value
- Since:
- 19387
-
getExifGpsDop
Return the GPS DOP value. The GPS DOP value from the temporary copy is returned if that copy exists.- Specified by:
getExifGpsDopin interfaceImageMetadata- Returns:
- the DOP value
- Since:
- 19387
-
getExifGpsDatum
Return the EXIF GPS coordinates datum value.- Specified by:
getExifGpsDatumin interfaceImageMetadata- Returns:
- The datum value
- Since:
- 19387
-
getExifGpsProcMethod
Return the EXIF GPS processing method string- Specified by:
getExifGpsProcMethodin interfaceImageMetadata- Returns:
- the processing method string
- Since:
- 19387
-
getGpsInstant
Returns the GPS time value. The GPS time value from the temporary copy is returned if that copy exists.- Specified by:
getGpsInstantin interfaceImageMetadata- Returns:
- the GPS time value
-
hasGpsTime
Convenient way to determine if this entry has a GPS time, without the cost of building a defensive copy.- Specified by:
hasGpsTimein interfaceImageMetadata- Returns:
trueif this entry has a GPS time- Since:
- 6450
-
getFile
Returns associated file.- Returns:
- associated file
-
getDisplayName
Returns a display name for this entry- Specified by:
getDisplayNamein interfaceImageMetadata- Returns:
- a display name for this entry
-
getExifOrientation
Returns EXIF orientation- Specified by:
getExifOrientationin interfaceImageMetadata- Returns:
- EXIF orientation
-
getExifInstant
Returns EXIF time- Specified by:
getExifInstantin interfaceImageMetadata- Returns:
- EXIF time
- Since:
- 17715
-
hasExifTime
Convenient way to determine if this entry has a EXIF time, without the cost of building a defensive copy.- Specified by:
hasExifTimein interfaceImageMetadata- Returns:
trueif this entry has a EXIF time- Since:
- 6450
-
getExifGpsInstant
Returns the EXIF GPS time.- Specified by:
getExifGpsInstantin interfaceImageMetadata- Returns:
- the EXIF GPS time
- Since:
- 17715
-
hasExifGpsTime
Convenient way to determine if this entry has a EXIF GPS time, without the cost of building a defensive copy.- Specified by:
hasExifGpsTimein interfaceImageMetadata- Returns:
trueif this entry has a EXIF GPS time- Since:
- 6450
-
getTimeSourceInstant
Return the time value selected with the parameter.- Specified by:
getTimeSourceInstantin interfaceImageMetadata- Parameters:
timeSource- the wanted time value, exifCamTime or exifGpsTime- Returns:
- exifInstant or exifGpsInstant value
- Since:
- 19426
-
getExifCoor
Description copied from interface:ImageMetadataGet the EXIF coordinates- Specified by:
getExifCoorin interfaceImageMetadata- Returns:
- The location of the image
-
getExifImgDir
Description copied from interface:ImageMetadataGet the EXIF direction- Specified by:
getExifImgDirin interfaceImageMetadata- Returns:
- The image direction
-
getExifGpsTrack
Convenient way to determine if this entry has a EXIF GPS track angle value, without the cost of building a defensive copy.- Specified by:
getExifGpsTrackin interfaceImageMetadata- Returns:
trueif this entry has a EXIF track angle value- Since:
- 19387
-
getExifHPosErr
Convenient way to determine if this entry has a EXIF GPS horizontal positionning error value, without the cost of building a defensive copy.- Specified by:
getExifHPosErrin interfaceImageMetadata- Returns:
trueif this entry has a EXIF GPS horizontal positionning error value- Since:
- 19387
-
getLastModified
Description copied from interface:ImageMetadataGet the last time the source was modified.- Specified by:
getLastModifiedin interfaceImageMetadata- Returns:
- The last time the source was modified
-
setWidth
Sets the width of this GpxImageEntry.- Specified by:
setWidthin interfaceImageMetadata- Parameters:
width- set the width of this GpxImageEntry- Since:
- 13220
-
setHeight
Sets the height of this GpxImageEntry.- Specified by:
setHeightin interfaceImageMetadata- Parameters:
height- set the height of this GpxImageEntry- Since:
- 13220
-
setPos
Sets the position.- Parameters:
pos- cached position
-
setPos
Sets the position.- Parameters:
pos- position (will be cached)
-
setPos
Description copied from interface:ImageMetadataSets the position.- Specified by:
setPosin interfaceImageMetadata- Parameters:
pos- position (will be cached)
-
setSpeed
Sets the speed.- Specified by:
setSpeedin interfaceImageMetadata- Parameters:
speed- speed
-
setElevation
Sets the elevation.- Specified by:
setElevationin interfaceImageMetadata- Parameters:
elevation- elevation
-
setGpsDiffMode
Sets GPS Differential mode.- Specified by:
setGpsDiffModein interfaceImageMetadata- Parameters:
gpsDiffMode- GPS Differential mode- Since:
- 19387
-
setGps2d3dMode
Sets GPS 2d/3d mode.- Specified by:
setGps2d3dModein interfaceImageMetadata- Parameters:
gps2d3dMode- GPS 2d/3d mode value- Since:
- 19387
-
setExifGpsDop
Sets GPS DOP value.- Specified by:
setExifGpsDopin interfaceImageMetadata- Parameters:
exifGpsDop- GPS DOP value- Since:
- 19387
-
setExifGpsDatum
Sets the GPS Datum.- Specified by:
setExifGpsDatumin interfaceImageMetadata- Parameters:
exifGpsDatum- GPS Datum- Since:
- 19387
-
setExifGpsProcMethod
Sets the GPS Processing Method.- Specified by:
setExifGpsProcMethodin interfaceImageMetadata- Parameters:
exifGpsProcMethod- GPS Processing Method- Since:
- 19387
-
setFile
Sets associated file.- Parameters:
file- associated file
-
setExifOrientation
Sets EXIF orientation.- Specified by:
setExifOrientationin interfaceImageMetadata- Parameters:
exifOrientation- EXIF orientation
-
setExifTime
Sets EXIF time.- Specified by:
setExifTimein interfaceImageMetadata- Parameters:
exifTime- EXIF time- Since:
- 17715
-
setExifGpsTime
Sets the EXIF GPS time.- Specified by:
setExifGpsTimein interfaceImageMetadata- Parameters:
exifGpsTime- the EXIF GPS time- Since:
- 17715
-
setGpsTime
Sets the GPS time.- Specified by:
setGpsTimein interfaceImageMetadata- Parameters:
gpsTime- the GPS time- Since:
- 17715
-
setExifCoor
Sets the EXIF coordinate.- Parameters:
exifCoor- the coordinate
-
setExifCoor
Description copied from interface:ImageMetadataSets the EXIF coordinates- Specified by:
setExifCoorin interfaceImageMetadata- Parameters:
exifCoor- The EXIF coordinates
-
setExifImgDir
Description copied from interface:ImageMetadataSets the EXIF direction- Specified by:
setExifImgDirin interfaceImageMetadata- Parameters:
exifDir- The direction
-
setExifGpsTrack
Sets the EXIF GPS track (move direction angle)- Specified by:
setExifGpsTrackin interfaceImageMetadata- Parameters:
exifGpsTrack- the EXIF GPS track angle- Since:
- 19387
-
setExifHPosErr
Sets the EXIF horizontal positioning error- Specified by:
setExifHPosErrin interfaceImageMetadata- Parameters:
exifHPosErr- the EXIF horizontal positionning error- Since:
- 19387
-
setIptcCaption
Sets the IPTC caption.- Specified by:
setIptcCaptionin interfaceImageMetadata- Parameters:
iptcCaption- the IPTC caption- Since:
- 15219
-
setIptcHeadline
Sets the IPTC headline.- Specified by:
setIptcHeadlinein interfaceImageMetadata- Parameters:
iptcHeadline- the IPTC headline- Since:
- 15219
-
setIptcKeywords
Sets the IPTC keywords.- Specified by:
setIptcKeywordsin interfaceImageMetadata- Parameters:
iptcKeywords- the IPTC keywords- Since:
- 15219
-
setIptcObjectName
Sets the IPTC object name.- Specified by:
setIptcObjectNamein interfaceImageMetadata- Parameters:
iptcObjectName- the IPTC object name- Since:
- 15219
-
getIptcCaption
Returns the IPTC caption.- Specified by:
getIptcCaptionin interfaceImageMetadata- Returns:
- the IPTC caption
- Since:
- 15219
-
getIptcHeadline
Returns the IPTC headline.- Specified by:
getIptcHeadlinein interfaceImageMetadata- Returns:
- the IPTC headline
- Since:
- 15219
-
getIptcKeywords
Returns the IPTC keywords.- Specified by:
getIptcKeywordsin interfaceImageMetadata- Returns:
- the IPTC keywords
- Since:
- 15219
-
getIptcObjectName
Returns the IPTC object name.- Specified by:
getIptcObjectNamein interfaceImageMetadata- Returns:
- the IPTC object name
- Since:
- 15219
-
compareTo
- Specified by:
compareToin interfaceComparable<GpxImageEntry>
-
hashCode
-
equals
-
createTmp
Make a fresh copy and save it in the temporary variable. UseapplyTmp()ordiscardTmp()if the temporary variable is not needed anymore.- Returns:
- the fresh copy.
-
getTmp
Get temporary variable that is used for real time parameter adjustments. The temporary variable is created if it does not exist yet. UseapplyTmp()ordiscardTmp()if the temporary variable is not needed anymore.- Returns:
- temporary variable
-
applyTmp
Copy the values from the temporary variable to the main instance. The temporary variable is deleted.- Since:
- 19387 exifGpsTrack, exifHPosErr, gpsDiffMode, gps2d3dMode, exifGpsDop, exifGpsDatum, exifGpsProcMethod added
- See Also:
-
discardTmp
Delete the temporary variable. Temporary modifications are lost.- See Also:
-
isTagged
If it has been tagged i.e. matched to a gpx track or retrieved lat/lon from exif- Returns:
trueif it has been tagged
-
toString
String representation. (only partial info) -
flagNewGpsData
Indicates that the image has new GPS data. That flag is set by new GPS data providers. It is used e.g. by the photo_geotagging plugin to decide for which image file the EXIF GPS data needs to be (re-)written.- Since:
- 6392
-
tmpUpdated
Indicate that the temporary copy has been updated. Mostly used to prevent UI issues. By default, this is a no-op. Override when needed in subclasses.- Since:
- 17579
-
getBBox
Description copied from interface:IQuadBucketTypeFetches the bounding box of the primitive.- Specified by:
getBBoxin interfaceIQuadBucketType- Returns:
- Bounding box of the object
-
unflagNewGpsData
Remove the flag that indicates new GPS data. The flag is cleared by a new GPS data consumer. -
hasNewGpsData
Queries whether the GPS data changed. The flag value from the temporary copy is returned if that copy exists.- Returns:
trueif GPS data changed,falseotherwise- Since:
- 6392
-
extractExif
Extract GPS metadata from image EXIF. Has no effect if the image file is not set If successful, fills in the LatLon, speed, elevation, image direction, and other attributes- Specified by:
extractExifin interfaceImageMetadata- Since:
- 9270
-
getInputStream
Description copied from interface:ImageMetadataGet the image input stream- Specified by:
getInputStreamin interfaceImageMetadata- Returns:
- The input stream of the image
- Throws:
IOException- If something happens during image read. See implementation for details.
-
read
Reads the image represented by this entry in the given target dimension.- Parameters:
target- the desired dimension used for subsampling ornull- Returns:
- the read image, or
null - Throws:
IOException- if any I/O error occurs- Since:
- 18246
-
getProjectionType
Get the projection type for this entry- Specified by:
getProjectionTypein interfaceImageMetadata- Returns:
- The projection type
- Since:
- 18246
-
setProjectionType
Description copied from interface:ImageMetadataSet the new projection type- Specified by:
setProjectionTypein interfaceImageMetadata- Parameters:
newProjection- The new type
-
asWayPoint
Returns aWayPointrepresentation of this GPX image entry.- Returns:
- a
WayPointrepresentation of this GPX image entry (containing position, instant and elevation) - Since:
- 18065
-