[gdal-dev] Problem with merging SHAPEs into SpatiaLite

Even Rouault even.rouault at spatialys.com
Thu Oct 5 14:10:33 PDT 2017


On jeudi 5 octobre 2017 05:20:02 CEST jratike80 wrote:
> Hi,
> 
> I have a bit similar problem with making queries with SQLite SQL dialect if
> shapefile name has numbers.
> For example this succeeds fine with GDAL 2.3dev on Windows:
> 
> ogrinfo -sql "select * from test2000" test2000.shp
> 
> but this does not

> 
> 
> ogrinfo -dialect sqlite -sql "select * from test2000" test2000.shp
> INFO: Open of `test2000.shp'
>       using driver `ESRI Shapefile' successful.
> ERROR 1: Cannot create virtual table for layer 'test2000' : CREATE VIRTUAL:
> inva
> lid SQL statement : CREATE TABLE "test2000"("KUNTANUMER"
> VARCHAR(3),"KUNTANIMI"
> VARCHAR(18),"MAAKUNTA" VARCHAR(2),"AVI" VARCHAR(2),"ELY"
> VARCHAR(2),"OGR_STYLE"
> VARCHAR(37),OGR_STYLE VARCHAR HIDDEN,"GEOMETRY" BLOB_POLYGON_XYZ_0,
> OGR_NATIVE_D
> ATA VARCHAR, OGR_NATIVE_MEDIA_TYPE VARCHAR)
> ERROR 1: In ExecuteSQL(): sqlite3_prepare_v2(select * from test2000):
>   no such table: test2000
> 

Nothing to do with the presence of numbers in the layer name. The issue here comes from 
the fact that your shapefile has a OGR_STYLE column, which confuses the SQLite SQL dialect 
wrapper that also tries to create a hidden OGR_STYLE column.
I've just pushed a fix in trunk.

Even

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20171005/eacf193c/attachment.html>


More information about the gdal-dev mailing list