my question might be related to this Dissolve using ogr2ogr gives 'no such function: ST_union'

What I am trying is st_unioning my landparcel polygons based on its group.

The code is very simple

ogr2ogr -overwrite -f "gpkg" landparcel_dissolve.gpkg landparcel.gpkg -dialect sqlite -sql "select ST_Union(geom), code from layer group by code"

but, when I tried this on my server it gives me this error

ERROR 1: In ExecuteSQL(): sqlite3_prepare_v2(select  ST_Union(st_makevalid(geometry)), code from layer group by code):
no such function: st_makevalid

Yet, when I tried this on my Mac OS Terminal, it works fine.

My Mac uses Sqlite version 3.27.1 and the server uses Sqlite version 3.7.17

But I do not think the sqlite version makes difference.

  • 1
    It is not the SQLite version that makes difference but the SpatiaLite version that was used when GDAL was compiled. The documentation gaia-gis.it/gaia-sins/spatialite-sql-latest.html does not tell in which SpatiaLite version each function appeared for the first time. It is also possible that SpatiaLite is compiled without LWGEOM based functions because GPL license may cause problems for some users. You can check the version with ogrinfo and -sql "select spatialite_version()". – user30184 Aug 23 at 6:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.