[Qgis-user] Loading SpatiaLite databases

Mike Leahy mgleahy at alumni.uwaterloo.ca
Sat Jul 31 15:43:41 PDT 2010


Hello list,

I'm having trouble opening an spatialite database that I created by importing  
a shapefile.  When I try to open the db, I get a message saying:

"Failure while connecting to:
/path/to/filename.sqlite

seems to be a valid SQLite DB, but not a SpatiaLite's one..."

I've found a couple references to this error in my searches online, but 
nothing conclusive yet.

I created the file by opening the db with 'spatialite /path/to/filename.db', 
then used the .loadshp command to import a shapefile into the database.  The 
data appear to be fine, and I can query it and the geometries all seem to work 
(e.g., "select area(Geometry) from tablename;" produces the expected output).

I also have the same problem if I use the OGR conversion utility in QGIS to 
convert a shapefile to SQLite - though I'm guessing in this case it's because 
OGR isn't creating an actual SpatiaLite file.

I'm doing this using QGIS 1.5 on 64-bit Ubuntu.  Here's the version 
information from spatialite:

SpatiaLite version ..: 2.4.0    Supported Extensions:
        - 'VirtualShape'        [direct Shapefile access]
        - 'VirtualDbf'          [direct DBF access]
        - 'VirtualText'         [direct CSV/TXT access]
        - 'VirtualNetwork'      [Dijkstra shortest path]
        - 'RTree'               [Spatial Index - R*Tree]
        - 'MbrCache'            [Spatial Index - MBR cache]
        - 'VirtualFDO'          [FDO-OGR interoperability]
        - 'SpatiaLite'          [Spatial SQL - OGC]
PROJ.4 version ......: Rel. 4.7.1, 23 September 2009
GEOS version ........: 3.2.2-CAPI-1.6.2
SQLite version ......: 3.6.22

Is there something incompatible here, or am I doing something wrong in the 
creation of the SpatiaLite DB?

Regards,
Mike



More information about the Qgis-user mailing list