<div dir="ltr"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><pre style="white-space:pre-wrap;color:rgb(0,0,0)">Will it easily be possible to extract such a photo from the spatialite file?</pre></blockquote><div>No, once created, the database itself could retrieve all the data without spatialite</div><div>- the exception being that the geometry could not be read</div><div>The position(s) are stored in extra fields</div><div>The image itself is a simple blob</div><div>- when written to a file (or read in as a QImage)</div><div>-- (in the case of jpg) a jpg with exif-Information will be read</div><div><br></div><div>While developing the concept, the idea was to create a general Album-logic</div><div>- that a non-spatialite drive could still read/write</div><div>-- but without out the geometry support</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><pre style="white-space:pre-wrap;color:rgb(0,0,0)">
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</pre></blockquote><div>With the exception of the last field 'album_geom', everything else can be read by a simple sqlite3 driver:</div><div><br></div><div>Here the CREATE statement for a table containing the images of one Album:</div><div><br></div><div>CREATE TABLE "Alt_Berlin_album_data" </div><div>(</div><div> id_album INTEGER PRIMARY KEY AUTOINCREMENT,</div><div> title TEXT NOT NULL DEFAULT '*** missing Title ***',</div><div> abstract TEXT NOT NULL DEFAULT '*** missing Abstract ***',</div><div> date_original DATETIME DEFAULT (datetime('now','localtime')),</div><div> mime_type TEXT NOT NULL,</div><div> tag_info TEXT NOT NULL DEFAULT 'historic:place',</div><div> copyright TEXT NOT NULL DEFAULT '',</div><div> image_path TEXT NOT NULL UNIQUE,</div><div> width INTEGER NOT NULL DEFAULT 0,</div><div> height INTEGER NOT NULL DEFAULT 0,</div><div> sample_type TEXT NOT NULL DEFAULT '*** undefined ***',</div><div> pixel_type TEXT NOT NULL DEFAULT '*** undefined ***',</div><div> num_bands INTEGER NOT NULL DEFAULT 1,</div><div> compression TEXT NOT NULL DEFAULT 'NONE',</div><div> nodata_pixel DOUBLE NOT NULL DEFAULT 0.0,</div><div> extent_min_x DOUBLE DEFAULT 0.0,</div><div> extent_min_y DOUBLE DEFAULT 0.0,</div><div> altitude DOUBLE DEFAULT 0.0,</div><div> extent_max_x DOUBLE DEFAULT 0.0,</div><div> extent_max_y DOUBLE DEFAULT 0.0,</div><div> distance DOUBLE DEFAULT 0.0,</div><div> bearing DOUBLE DEFAULT 0.0, </div><div> image BLOB,</div><div> image_thumbnail BLOB,</div><div> exif_json TEXT NOT NULL DEFAULT ''</div><div> , "album_geom" MULTIPOINT) </div><div><br></div><div>If an sqlite3 driver inserted a record, leaving the geometry field(s) NULL</div><div>- the spatialite logic would simply create the geometries either from</div><div>-- the extent_min* for GPS</div><div>-- the extent_max* for GPS_DEST</div><div>or by reading the image when it contains Exif-Gps Information</div><div><br></div><div>The goal was to make it useable for all</div><div>- with an extra for GIS aware software</div><div><br></div><div>--</div><div><br></div><div>Here the CREATE statement for the administration table<br></div><div>- the extents are calculated during an INSERT/UPDATE with spatialite, but the result is readable by any sqlite3 driver</div><div>-- again the geometries would only useful for spatialite aware software </div><div><br></div><div><div>CREATE TABLE "album_coverages" </div><div>(</div><div> id_album INTEGER PRIMARY KEY AUTOINCREMENT,</div><div> id_parent INTEGER DEFAULT 0 ,</div><div> album_name TEXT NOT NULL,</div><div> title TEXT NOT NULL DEFAULT '',</div><div> abstract TEXT NOT NULL DEFAULT '',</div><div> images_count INTEGER DEFAULT 0 ,</div><div> extent_min_x DOUBLE DEFAULT 0.0,</div><div> extent_min_y DOUBLE DEFAULT 0.0,</div><div> extent_max_x DOUBLE DEFAULT 0.0,</div><div> extent_max_y DOUBLE DEFAULT 0.0</div><div>, "album_geom" POLYGON, "album_points" MULTIPOINT, "album_linestrings" MULTILINESTRING, "album_geomcollection" GEOMETRYCOLLECTION)</div></div><div><br></div><div>Mark</div><div><br></div></div>