[gdal-dev] promote_to_multi and python API

Kai Mühlbauer kai.muehlbauer at uni-bonn.de
Thu Dec 10 00:58:03 PST 2020


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 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 to avoid calling `ogr2ogr` from
> Python code? :-)
> 
> Thanks, Martin
> 



More information about the gdal-dev mailing list