Skip to content

Instantly share code, notes, and snippets.

@casajarm
Last active March 3, 2020 18:07
Show Gist options
  • Save casajarm/11a648bd6e7082348218e8a78cb10f8e to your computer and use it in GitHub Desktop.
Save casajarm/11a648bd6e7082348218e8a78cb10f8e to your computer and use it in GitHub Desktop.
Extract GPS Coordinates from JPG stored as BLOB in Oracle Database
SELECT extractvalue(value(exif), '//exifMetadata/GpsIfd/GPSLatitude'
, 'xmlns="http://xmlns.oracle.com/ord/meta/exif"') AS latitude
, extractvalue(value(exif), '//exifMetadata/GpsIfd/GPSLongitude'
, 'xmlns="http://xmlns.oracle.com/ord/meta/exif"') AS longitude
FROM photos
, TABLE((ordsys.ordimage.getmetadata(photo_image, 'EXIF'))) exif
WHERE photo_id = :ID /* optional filter */
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment