Skip to content

TIKA-4781: Map EXIF GPS altitude to the existing geo:alt property#2941

Open
dschmidt wants to merge 1 commit into
apache:mainfrom
dschmidt:exif-gps-altitude
Open

TIKA-4781: Map EXIF GPS altitude to the existing geo:alt property#2941
dschmidt wants to merge 1 commit into
apache:mainfrom
dschmidt:exif-gps-altitude

Conversation

@dschmidt

@dschmidt dschmidt commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

JIRA: https://issues.apache.org/jira/browse/TIKA-4781

ImageMetadataExtractor's GeotagHandler maps latitude, longitude and
the GPS timestamp from the EXIF GpsDirectory, but not the altitude,
although tika-core defines Geographic.ALTITUDE ("geo:alt") and
metadata-extractor exposes the value in the same directory. Consumers
currently only get the raw description string
(GPS:GPS Altitude = "227.4 metres").

This sets geo:alt as a signed value honoring GPSAltitudeRef
(1 = below sea level = negative), formatted with the same
DecimalFormat as latitude and longitude.

Analogous to TIKA-4425, which added the normalized GPS timestamp from
the same directory; see TIKA-2861 for the corresponding ISO 6709
altitude handling on the MP4/QuickTime side.

Testing: handler-level tests cover the above and below sea level cases;
the existing IMG_1034.heic fixture already carries an altitude
(42.810337 m), so HeifParserTest now asserts the mapping end to end.
No fixtures added or modified.

The GeotagHandler mapped latitude, longitude and the GPS timestamp from
the EXIF GpsDirectory, but not the altitude, although tika-core defines
Geographic.ALTITUDE and metadata-extractor exposes the value in the same
directory. Consumers only got the raw description string
("GPS:GPS Altitude" = "227.4 metres").

Set geo:alt as a signed value honoring GPSAltitudeRef (1 = below sea
level = negative), formatted with the same DecimalFormat as latitude
and longitude. Analogous to TIKA-4425, which added the normalized GPS
timestamp from the same directory; see TIKA-2861 for the corresponding
ISO 6709 altitude handling in MP4/QuickTime.

The existing IMG_1034.heic fixture already carries an altitude, so
HeifParserTest now asserts it end to end; handler-level tests cover the
above and below sea level cases.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant