[gdal-dev] ogr2ogr.py sqlite dialect unsupported?

Martin Lacayo mlacayoemery at gmail.com
Tue Sep 3 04:02:42 PDT 2019


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 <even.rouault at spatialys.com> 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


More information about the gdal-dev mailing list