Thank you, the following code worked perfectly: import os import osgeo.gdal
name, ext = os.path.splitext(os.path.basename(in_path)) srcDS = osgeo.gdal.OpenEx(in_path) ds = osgeo.gdal.VectorTranslate(out_path, srcDS, SQLStatement="SELECT ST_Union(geometry) FROM " + name , SQLDialect='sqlite') Cheers, Martin On Mon, Sep 2, 2019 at 6:19 PM Even Rouault <[email protected]> wrote: > > ogr2ogr.py is a toy / sample file which receives little maintainance, and was > mostly a one-time port of the ogr2ogr.cpp source, which is the on used by the > command line utility. > > You may use the 'librarified' ogr2ogr with the gdal.VectorTranslate() Python > function. Examples at > https://github.com/OSGeo/gdal/blob/master/autotest/utilities/ > test_ogr2ogr_lib.py#L63 > > Even > > -- > Spatialys - Geospatial professional services > http://www.spatialys.com _______________________________________________ gdal-dev mailing list [email protected] https://lists.osgeo.org/mailman/listinfo/gdal-dev
