To create a slimmed down version, with an minimal amount needed, use InitSpatialMetaData(1,'NONE') when creating a new database. This will create a Database as in version 4.3, with an empty spatial_ref_sys table.
Since SpatiaLite 5.0, AddGeometry will also add any needed srid to the spatial_ref_sys table.
In the past, using sql-scripts, I have created 'production' databases (i.e. slimmed down version to what is really needed) from a 'development' database.
This would then be a combination of:
- InitSpatialMetaData(1,'NONE')
and then ATTACH your development db and use CloneTable to import what you need.
All of this can be done from an sql-script.
See SpatiaLite Cookbook V5 at https://www.gaia-gis.it/gaia-sins/spatialite-cookbook-5/index.html for many samples of more complicated sql samples.
Mark
Thanks in advance.Dick
Thank you, this is very helpful.To be clear - this needs to be done in the CLI to get started, correct?
I gather that if I create a new db in the gui it will always use InitSpatialMetaDataFull.
thanks, in the meantime, I have been trying it in the CLIWin10 environment spatialite-tools-5.0.0-win-amd64 spatialite.exeIt appears that all tables are created in any case.
--
You received this message because you are subscribed to the Google Groups "SpatiaLite Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to spatialite-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/spatialite-users/70a31025-ed56-492d-bc52-e94d02cbaa51n%40googlegroups.com.
After consultation today with other members of the project team, we have elected to take Sandro's suggestion and adopt a full spatialite implementation with no concerns at this time about cutting it down.So this leads to the question of how best to convert an existing sqlite database to spatialite. I tried Mark's suggestion of creating a new spatialite database, attaching the existing sqlite db and cloning
, but when I attempt to clone a table from the attached sqlite db, I get: "Sqlite view-source ql Error: no such table a.geometry_columns".