Spatialite failing to read

Sep 24, 2012 at 9:10 AM

I have created a simple spatial database by loading shapefiles in spatialite using spatialite-GUI.exe
But when i try to load this database in my dotspatial application using the spatiallite plugin it gives me this error:

"its not a valid spatialite database. Table geometry_columns not found."

I have tried to change the name of the geomtry column but it doesnt work.

can anyone help on this?

Sep 24, 2012 at 9:53 AM

If I'm not mistaken, The SpatiaLite plugin was created using version v2.3.1 of SpatiaLite. If you've used version 2.4 or later (meanwhile there is 4.0rc1 out) the database schema is likely to be different than it is expected.

Rereate your SpatiaLite database using the spatialite-gui that matches spatialite v2.3.1 (which is v1.2.1)

Hth FObermaier

Sep 24, 2012 at 1:30 PM

Thanks FObermaier. Yes it seem to be different. It doesnt create a table called geometry_columns anymore which spatialite plugin looks for while searching for valid tables to load layers. Any idea if spatialite will be updated on it? as the spatialite_GUI is built on sqlite version 3.5.9, means i will have to go back to older version with command line scripts to generate the spatial database :(

Sep 24, 2012 at 3:28 PM

I have tried something like this and it works fine for me now:

I downloaded a sample database of some older version of spatialite. it had all the necessary tables that sqlite plugin needs. Then i droped the existing tables (shapefiles) from it and manually deleted (using sql delete command) their respective entries from geometry_columns table. Then i loaded my own shape files with proper SRIDs (27700 British National Grid in my case) and it works fine for now.

I hope it will help others until new version of sqlite is released, that can read the new database schema.