[gdal-dev] ogr2ogr segfault

Even Rouault even.rouault at spatialys.com
Tue May 19 03:25:53 PDT 2015


Le mardi 19 mai 2015 12:21:15, Ari Jolma a écrit :
> >>>> Hi all.
> >>>> I'm consistently getting a segfault from:
> >>>> 
> >>>> ogr2ogr OUTPUTLAYER.shp strade.shp strade -dialect sqlite -sql "SELECT
> >>>> ST_Line_Interpolate_Point( geometry , 0.5 ),* FROM 'strade' "
> >>>> 
> >>>> Anything I can do for debugging?
> >>> 
> >>> Running under gdb and displaying the stack trace.
> >> 
> >> ogr2ogr OUTPUTLAYER.shp strade.shp -dialect sqlite -sql "SELECT
> >> ST_Line_Interpolate_Point( geometry , 0.5 ),* FROM 'strade'"
> >> ERROR 1: In ExecuteSQL(): sqlite3_prepare(SELECT
> >> 
> >> ST_Line_Interpolate_Point( geometry , 0.5 ),* FROM 'strade'):
> >>     no such function: ST_Line_Interpolate_Point
> >> 
> >> I have both SQLite and SpatiaLite support on. What's going on?
> > 
> > Not using a recent enough SpatiaLite I guess
> 
> I've now got the latest SpatiaLite version but ogr2ogr is still
> complaining.

Check with

ogrinfo  strade.shp -dialect sqlite -sql "select spatialite_version()"

that you're linking against the spatialite version you expect.

> 
> However, I got also the SpatiaLite CLI and it has no problems:
> 
> spatialite> .loadshp strade strade utf8
> ========
> Loading shapefile at 'strade' into SQLite table 'strade'
> 
> BEGIN;
> CREATE TABLE "strade" (
> "PK_UID" INTEGER PRIMARY KEY AUTOINCREMENT,
> "id" INTEGER);
> SELECT AddGeometryColumn('strade', 'Geometry', -1, 'LINESTRING', 'XY');
> COMMIT;
> 
> Inserted 1 rows into 'strade' from SHAPEFILE
> ========
> spatialite> SELECT astext(ST_Line_Interpolate_Point( geometry , 0.5 )),*
> FROM 'strade';
> POINT(-0.352046 0.4463)|1|0|
> 
> Hm.
> 
> Ari

-- 
Spatialys - Geospatial professional services
http://www.spatialys.com


More information about the gdal-dev mailing list