How can I convert features of a layer from POLYGON to MULTIPOLYGON? I know how to do that using the postgis function ST_Multi but how could I do to same thing for a layer in QGIS?
2 Answers
If you want to do it based on a field, you can do this in QGIS from the menu: Vector --> Geometry Tools --> Collect Geometries
(requires at least two poylgons to share an attribute that you specify).
There is a more direct equivalent to ST_Multi in OGR. I didn't find a way to access this specific OGR functionality through QGIS, but that could be done using GDAL/OGR like this ogr2ogr -nlt MULTIPOLYGON multipolygon_output.shp polygon_input.shp
More details on -nlt switch are available on the ogr2ogr page.
-
I mamanged to do it with GDAL/OGR as you said, thanks. Let's see if someone can find a solution to this directly in QGIS.– EgidiCommented May 14, 2015 at 13:17
-
2
While still waiting for the simple QGIS solution you can have a look at how it goes with OpenJUMP through the right-click menu: