Re: [gdal-dev] promote_to_multi and python API

2020-12-10 Thread Norman Vine via gdal-dev
I usually peruse the ogr2ogr.py source for hints maybe this helps https://github.com/OSGeo/gdal/blob/master/gdal/swig/python/samples/ogr2ogr.py#L1512 > On Dec 10, 2020, at 3:39 AM, Martin Landa wrote: > > Hi, > > is there a way to apply PROMOTE_TO_MULTI in Python API? I am trying to > write a s

Re: [gdal-dev] promote_to_multi and python API

2020-12-10 Thread Even Rouault
Martin, > > napsal: > > not sure if this helps you, but "PROMOTE_TO_MULTI" can be added as > > option with several OGR functions with the Python API (eg. Intersection, > > Update, Identity etc.). > > yes, thanks for pointing this out. But it seems to be not possible for > CopyLayer() which is t

Re: [gdal-dev] promote_to_multi and python API

2020-12-10 Thread jratike80
Hi, You do not need to call ogr2ogr because there is a python library equivalent "gdal.VectorTranslate". You can find a PROMOTE_TO_MULTI example from the autotests https://github.com/OSGeo/gdal/blob/master/autotest/utilities/test_ogr2ogr_lib.py#L539 -Jukka Rahkonen- Martin Landa wrote > Hi, >

Re: [gdal-dev] promote_to_multi and python API

2020-12-10 Thread Martin Landa
Hi, čt 10. 12. 2020 v 9:58 odesílatel Kai Mühlbauer napsal: > not sure if this helps you, but "PROMOTE_TO_MULTI" can be added as > option with several OGR functions with the Python API (eg. Intersection, > Update, Identity etc.). yes, thanks for pointing this out. But it seems to be not possible

Re: [gdal-dev] promote_to_multi and python API

2020-12-10 Thread Kai Mühlbauer
Hi Martin, not sure if this helps you, but "PROMOTE_TO_MULTI" can be added as option with several OGR functions with the Python API (eg. Intersection, Update, Identity etc.). See https://gdal.org/python/osgeo.ogr.Layer-class.html HTH, Kai Am 10.12.20 um 09:39 schrieb Martin Landa: Hi, is

[gdal-dev] promote_to_multi and python API

2020-12-10 Thread Martin Landa
Hi, is there a way to apply PROMOTE_TO_MULTI in Python API? I am trying to write a sample script for students in Python which converts SHP file to PostGIS layers. I am dealing with a well known problem "Geometry type (MultiXXX) does not match column type (XXX)". How to solve it properly in order