[gdal-dev] AsGeoJSON with SQLite dialect returns an empty string

Even Rouault even.rouault at spatialys.com
Thu Mar 28 08:31:49 PDT 2019


On jeudi 28 mars 2019 15:01:20 CET Rahkonen Jukka (MML) wrote:
> Hi,
> 
> I noticed this question
> https://gis.stackexchange.com/questions/316776/ogr2ogr-fails-with-no-such-t
> able and tried to study that odd shapefile by repeating the test with GDAL
> 2.4.0 from OSGeo4W and there happens something with ST_AsGeoJSON that I do
> not understand.

Jukka,

This is a Spatialite bug specific of ST_AsGeoJSON + Geopackage geometry blobs. 
I've sent a patch to the Spatialite maintainer to fix it.

Other workarounds:
- for no precision loss at all, you can also do:
AsGeoJSON(ST_GeomFromWKT(AsBinary(geom)))
- or you can also use -dialect indirect_sqlite that will go through the slower 
indirection of using a virtual sqlite table with spatialite geometries.

Even

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


More information about the gdal-dev mailing list