[gdal-dev] New OGR driver: Imageset

Even Rouault even.rouault at mines-paris.org
Mon Jul 23 01:48:14 PDT 2012


Le lundi 23 juillet 2012 09:51:14, Tamas Szekeres a écrit :
> Hi All,
> 
> We're thinking about implementing a new OGR driver which would represent a
> set of images as a vector data source. The images are taken from any GPS
> compatible mobile device, and each picture would be represented as a point
> feature, the positions would be extracted from the exif information. The
> file name and path would be provided as an attribute for each feature. This
> data source could then be used by higher level apps to provide symbols at
> the picture locations in the map and display the picture when the feature
> is selected. The driver would definitely use GDAL to extract information
> about the provided images.
> 
> I'm not sure whether we already have some kind of alternative solution to
> this, let me know if you know about any. Further ideas about this topic
> would also be helpful.

The JPEG driver already exposes EXIF information if found :

$ gdalinfo ../autotest/gdrivers/data/albania.jpg
Driver: JPEG/JPEG JFIF
Files: ../autotest/gdrivers/data/albania.jpg
Size is 361, 260
Coordinate System is `'
Metadata:
[...]
  EXIF_GPSLatitude=(41) (1) (22.91)
  EXIF_GPSLatitudeRef=N
  EXIF_GPSLongitude=(19) (55) (42.35)
  EXIF_GPSLongitudeRef=E
[...]

$ gdalinfo ../autotest/gcore/data/exif_and_gps.tif -mdd EXIF
Driver: GTiff/GeoTIFF
Files: ../autotest/gcore/data/exif_and_gps.tif
Size is 1, 1
Coordinate System is `'
[..]
Metadata (EXIF):
[...]
  EXIF_GPSLatitude=(77) (5) (60)
  EXIF_GPSLatitudeRef=S
  EXIF_GPSLongitude=(34) (12) (0)
  EXIF_GPSLongitudeRef=E
[..]

Are you thinking to other raster formats to extract EXIF info from? To my 
knowledge, the JPEG driver, and recently the GTiff driver, are the only one 
that extract EXIF for now. I see that the JPEG driver exposes it in the 
default metadata domain, whereas I chose EXIF for the GTiff driver. For GTiff, 
the specific EXIF metadata domain seemed better to me to avoid 'polluting' the 
default metadata domain, but I didn't want to change the JPEG driver at that 
point. But this would probably requires some harmonization.

So with some scripting, you could create for example a point shapefile, with 
the filename as attribute and GPS position as geometry.

In its syntax, this could be something similar to gdaltindex.

Doing that as a OGR driver would be also doable of course. The only point to 
solve is the definition of the connexion string to specify the image set.

> 
> Best regards,
> 
> Tamas


More information about the gdal-dev mailing list