Re: [gdal-dev] Wrongly identified SQLITE_BLOB as geomtry

2016-10-24 Thread Christian Urich
Hi Even and Jukka, Thanks for the quick fixes! Just tested the code from the master and it works for my use case. Cheers Christian On 24 October 2016 at 11:33:17 pm, Even Rouault (even.roua...@spatialys.com) wrote: Le lundi 24 octobre 2016 14:10:34, Christian Urich a écrit : > Hi, > > will

Re: [gdal-dev] Wrongly identified SQLITE_BLOB as geomtry

2016-10-24 Thread Even Rouault
Le lundi 24 octobre 2016 14:10:34, Christian Urich a écrit : > Hi, > > will do. > > I run into another problem. The update statement for multiple geometry > fails. > > ERROR 1: In SetFeature(): sqlite3_prepare(UPDATE 'timeseries' SET "data" = > ?"GEOMETRY" = ?,"end" = ?,"start" = ?,"station_id"

Re: [gdal-dev] Wrongly identified SQLITE_BLOB as geomtry

2016-10-24 Thread Christian Urich
Hi, will do. I run into another problem. The update statement for multiple geometry fails. ERROR 1: In SetFeature(): sqlite3_prepare(UPDATE 'timeseries' SET "data" = ?"GEOMETRY" = ?,"end" = ?,"start" = ?,"station_id" = ?,"timestep" = ?,"type" = ?,"s" = ? WHERE "ogc_fid" = 1): near ""GEOMETRY""

Re: [gdal-dev] Wrongly identified SQLITE_BLOB as geomtry

2016-10-24 Thread jratike80
Hi, It does smell like a bug. Could you repeat my test and take care to have the additional BLOB field created after the geometry field? For me this workaround seems to work and there is only one geometry left and "data" field is reported as "binary" type. FID Column = ogc_fid Geometry Column = g

Re: [gdal-dev] Wrongly identified SQLITE_BLOB as geomtry

2016-10-24 Thread Even Rouault
Le lundi 24 octobre 2016 13:21:46, Christian Urich a écrit : > Here is a link to a small test database > > https://www.dropbox.com/s/vwu4q7ud3e3sv2y/binary_blob.sqlite.zip?dl=0 > > > The problem seems to come up when the BLOB

Re: [gdal-dev] Wrongly identified SQLITE_BLOB as geomtry

2016-10-24 Thread Christian Urich
It is a spatialite database. The data field is the SQLITE_BLOB that should not be recognised as geometry. On 24 October 2016 at 10:42:21 pm, jratike80 ( jukka.rahko...@maanmittauslaitos.fi) wrote: How did you create the database? It is a spatial db for Spatialite as well because it contains a

Re: [gdal-dev] Wrongly identified SQLITE_BLOB as geomtry

2016-10-24 Thread jratike80
How did you create the database? It is a spatial db for Spatialite as well because it contains also field GEOMETRY which is registered in geometry_columns. DLL of the "timeseries" table is CREATE TABLE 'timeseries' ( ogc_fid INTEGER PRIMARY KEY, 'data' BLOB, 'end' VARCHAR, 'start' VARCHAR, 'statio

Re: [gdal-dev] Wrongly identified SQLITE_BLOB as geomtry

2016-10-24 Thread Christian Urich
Here is a link to a small test database https://www.dropbox.com/s/vwu4q7ud3e3sv2y/binary_blob.sqlite.zip?dl=0 The problem seems to come up when the BLOB is a bit bigger. I couldn’t reproduce it with a smaller dataset. Fo

Re: [gdal-dev] Wrongly identified SQLITE_BLOB as geomtry

2016-10-24 Thread jratike80
Please put a test db somewhere or describe how to create such a database. I made a quick test by importing some XML file with spatialite-gui 1.8.0-dev. it creates a table as CREATE TABLE "xml" ( "pk_uid" INTEGER PRIMARY KEY AUTOINCREMENT, "xml_document" BLOB NOT NULL ,"file_name" TEXT NOT NULL ,"s

[gdal-dev] Wrongly identified SQLITE_BLOB as geomtry

2016-10-24 Thread Christian Urich
Hi all, I have created a binary blob in a spatialite db. If I try to open the db the column is wrongly identified as geometry which causes all kinds of problems. Is there a way to force gdal to only consider the geometry_columns table? Cheers Christian _