[QGIS-Developer] Importing shp into gpkg or PostGIS as SINGLE geometry gives MULTI?

Giovanni Manghi giovanni.manghi at gmail.com
Tue Oct 1 10:17:19 PDT 2019


> Correct, but in the importing popup there is an option to transform into
> single. It usually works, at least for points, so it's unclear why it
> shouldn't in this case.
> Cheers.
>


despite its name, that has been always confusing, that option in DB Manager
never transformed geometries to SINGLE from MULTI along the import process).

What the option means (meant?) is that if I have a layer that is declared
as MULTI but actually has no multipart geometries in it, then it can be
imported as a non-MULTI table.

In past QGIS releases if you had a layer with a multi-geometry and checked
that option then DB manager returned an error like

Error 7

Feature write errors:

Creation error for features from #0 to #0. Provider errors was:

Geometry type MultiLineString not compatible with provider type LineString.

PostGIS error while adding features: ERROR: Geometry type (MultiLineString)
does not match column type (LineString)

now it does not and imports to MULTI anyway and silently. And it does also
if you don't have any multi-geometry, which of course are both bugs and
regressions.


Error 7

Feature write errors:

Creation error for features from #0 to #0. Provider errors was:

Geometry type MultiLineString not compatible with provider type LineString.

PostGIS error while adding features: ERROR: Geometry type (MultiLineString)
does not match column type (LineString)
-- G --
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20191001/60048ca3/attachment.html>


More information about the QGIS-Developer mailing list