[GIS] How to create a new Spatialite database in QGIS

qgisspatialitevector

I've been trying to create a new spatialite database within QGIS 1.8 (SpatiaLite Version 3.0.1; QSpatialite 6.0.3) and keep getting this error: "The SQL query seems to be invalid.
no such table: views_geometry_columns" and then "This DataBase seems to be a valid SQLite DataBase but not a valid SpatiaLite One, Would you like QSpatiaLite to automatically transform it to SpatiaLite (information won't be lost) ?" and after "Yes" comes "Unable to convert Database to SpatiaLite".

What am I doing wrong? There was no problems with old version (QGIS 1.7.4 and QSpatialite 5.0.3).

Please advise regarding creating a new Spatialite database.


Spatialite-gui did the trick. You just have to have right SRID.
Here is the SRID list
http://drupalcode.org/project/geo.git/blob/ee3f75649e4b01dfd27d8e35b222a2b51c93d706:/srid.inc

Thank you all for your effort and time!

Best Answer

Qspatialite is incompatible with spatialite 3 (see http://code.google.com/p/qspatialite/issues/detail?id=6) and AFAIK DB Manager is incompatible too. Use spatialite-gui (https://www.gaia-gis.it/fossil/spatialite_gui/index) to manage your database and ogr2ogr to add or export layers. Or install spatialite 2.x.