[QGIS-Developer] Regular vs spatialite sqlite database

Mark Johnson mj10777 at googlemail.com
Mon Jul 24 02:58:41 PDT 2017


>> My second implementation uses Spatialite DB but I found it surprisingly
slower than shapefile and the file created is very big (more than 5 MB)
also for empty tables. Requirements number 2 and 3 are successfully
satisfied.

One reason a default spatialite Database is so big, is because
'spatial_ref_sys' is filled with all know projections (At present 4924
entries).
- this is done with 'SELECT InitSpatialMetaData()'

You can can create a 'spatial_ref_sys' that is smaller:
-  'SELECT InitSpatialMetaData('WGS84')'
-> would create a 'spatial_ref_sys'  with only one entry (Wsg84)
-  'SELECT InitSpatialMetaData('NONE')'
-> would create a 'spatial_ref_sys' that is empty

You *must* fill 'spatial_ref_sys' with entries for:
- the geometries that you are *using/filling* in the Database
- or where you wish to *transform* to another projection (i.e.
ST_Transform(geometry,3068)

With "SELECT InsertEpsgSrid(3068)"
- you would add an 'EPSG:3068' entry to 'spatial_ref_sys'

http://www.gaia-gis.it/gaia-sins/spatialite-sql-latest.html#p16

Mark Johnson, Berlin Germany
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20170724/5909dde0/attachment.html>


More information about the QGIS-Developer mailing list