[gdal-dev] promote_to_multi and python API

jratike80 jukka.rahkonen at maanmittauslaitos.fi
Thu Dec 10 04:27:38 PST 2020


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,
> 
> 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
> 
> -- 
> Martin Landa
> http://geo.fsv.cvut.cz/gwiki/Landa
> http://gismentors.cz/mentors/landa
> _______________________________________________
> gdal-dev mailing list

> gdal-dev at .osgeo

> https://lists.osgeo.org/mailman/listinfo/gdal-dev





--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list