[Qgis-developer] Geophoto management

Mark Johnson mj10777 at googlemail.com
Mon Jul 4 05:29:04 PDT 2016


>
> Will it easily be possible to extract such a photo from the spatialite file?
>
> No, once created, the database itself could retrieve all the data without
spatialite
- the exception being that the geometry could not be read
The position(s) are stored in extra fields
The image itself is a simple blob
- when written to a file (or read in as a QImage)
-- (in the case of jpg) a jpg with exif-Information will be read

While developing the concept, the idea was to create a general Album-logic
- that a non-spatialite drive could still read/write
-- but without out the geometry support

>
> Thinking about QField (mobile application), I like the in-database
> approach for its portability but fear that the photos will be locked in
> there and that it will be quite hard to use them for a report written in
> an application that does not support RasterLite2.
>
> Matthias
>
> With the exception of the last field 'album_geom', everything else can be
read by a simple sqlite3 driver:

Here the CREATE statement for a table containing the images of one Album:

CREATE TABLE "Alt_Berlin_album_data"
(
 id_album INTEGER PRIMARY KEY AUTOINCREMENT,
 title TEXT NOT NULL DEFAULT '*** missing Title ***',
 abstract TEXT NOT NULL DEFAULT '*** missing Abstract ***',
 date_original DATETIME DEFAULT (datetime('now','localtime')),
 mime_type TEXT NOT NULL,
 tag_info TEXT NOT NULL DEFAULT 'historic:place',
 copyright TEXT NOT NULL DEFAULT '',
 image_path TEXT NOT NULL UNIQUE,
 width INTEGER NOT NULL DEFAULT 0,
 height INTEGER NOT NULL DEFAULT 0,
 sample_type TEXT NOT NULL DEFAULT '*** undefined ***',
 pixel_type TEXT NOT NULL DEFAULT '*** undefined ***',
 num_bands INTEGER NOT NULL DEFAULT 1,
 compression TEXT NOT NULL DEFAULT 'NONE',
 nodata_pixel DOUBLE NOT NULL DEFAULT 0.0,
 extent_min_x DOUBLE DEFAULT 0.0,
 extent_min_y DOUBLE DEFAULT 0.0,
 altitude DOUBLE DEFAULT 0.0,
 extent_max_x DOUBLE DEFAULT 0.0,
 extent_max_y DOUBLE DEFAULT 0.0,
 distance DOUBLE  DEFAULT 0.0,
 bearing DOUBLE  DEFAULT 0.0,
 image BLOB,
 image_thumbnail BLOB,
 exif_json TEXT NOT NULL DEFAULT ''
 , "album_geom" MULTIPOINT)

If an sqlite3 driver inserted a record, leaving the geometry field(s) NULL
- the spatialite logic would simply create the geometries either from
-- the extent_min* for GPS
-- the extent_max* for GPS_DEST
or by reading the image when it contains Exif-Gps Information

The goal was to make it useable for all
- with an extra for GIS aware software

--

Here the CREATE statement for the administration table
- the extents are calculated during an INSERT/UPDATE with spatialite, but
the result is readable by any sqlite3 driver
-- again the geometries would only useful for spatialite aware software

CREATE TABLE "album_coverages"
(
 id_album INTEGER PRIMARY KEY AUTOINCREMENT,
 id_parent INTEGER DEFAULT 0 ,
 album_name TEXT NOT NULL,
 title TEXT NOT NULL DEFAULT '',
 abstract TEXT NOT NULL DEFAULT '',
 images_count INTEGER DEFAULT 0 ,
 extent_min_x DOUBLE DEFAULT 0.0,
 extent_min_y DOUBLE DEFAULT 0.0,
 extent_max_x DOUBLE DEFAULT 0.0,
 extent_max_y DOUBLE DEFAULT 0.0
, "album_geom" POLYGON, "album_points" MULTIPOINT, "album_linestrings"
MULTILINESTRING, "album_geomcollection" GEOMETRYCOLLECTION)

Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20160704/9e2cbd49/attachment.html>


More information about the Qgis-developer mailing list