[Qgis-developer] SpatiaLite layers invisible when loaded from browser

Even Rouault even.rouault at mines-paris.org
Wed Feb 29 14:09:32 EST 2012


Le mercredi 29 février 2012 08:45:21, Paolo Cavallini a écrit :
> Il 28/02/2012 20:23, Even Rouault ha scritto:
> > I don't confirm. It works for me with both GDAL 1.9.0 and GDAL trunk, at
> > least on the attached simple example.
> 
> Confirmed: your sample is ok. The sample file[0] does not load correctly
> here. Thanks.

I also reproduce the error with the test-2.3 database. The difference with the 
poly.sqlite that I sent before is that test-2.3 contains no spatial index.

The console has interesting error messages :

ERROR 1: In ResetStatement(): sqlite3_prepare(SELECT _rowid_, * FROM 'Towns' 
WHERE MBRIntersects("Geometry", BuildMBR(-213552396.323174118996, 
-167417043.364000141621, 215180205.733174085617, 176566090.844000160694, 
32632))):
  no such function: BuildMBR

I'd note that you get the same behaviour when opening from "Open a Vector 
Layer" (which uses the OGR driver)

What is more interesting is that the same request run from ogrinfo works 
perfectly....

I'm afraid the reason why it does not work in QGIS is that it has the bad idea 
of embedding directly libspatialite in /usr/lib/libqgis_core.so.1.9.90 instead 
of dynamically linking to the one provided by the system. So I highly suspect 
a conflict between the libspatialite linked by libgdal.so and the one linked by 
libqgis_core, especially if they are not the same version ....

Another point is  that the QGIS File Browser only displays the first OGR layer, 
whereas when opening with "Open a Vector Layer", you can choose among all OGR 
layers.


> 
> [0]http://www.gaia-gis.it/spatialite-2.3.1/test-2.3.zip


More information about the Qgis-developer mailing list