Opened 14 years ago
Closed 14 years ago
#2188 closed bug (fixed)
Merging of multipolygons fail/issues
Reported by: | lutra | Owned by: | nobody |
---|---|---|---|
Priority: | major: does not work as expected | Milestone: | Version 1.4.0 |
Component: | Build/Install | Version: | Trunk |
Keywords: | Cc: | ||
Must Fix for Release: | Yes | Platform: | All |
Platform Version: | Awaiting user input: | no |
Description
This ticket was open after the observations made here
http://lists.osgeo.org/pipermail/qgis-developer/2009-December/008552.html
To replicate: use the "regions" layer you can find in the spatialite sample dataset: you can save it as shapefile and import to postgis. Tested also with other layers, like the "world borders" vector.
a) In postgis and Spatialite (in a multipolygon type of layer), merging adjacent or overlapping features returns
"The union operation would result in a geometry type that is not compatible with the current layer and therefore is canceled"
b) The same message appear when you try to merge non adjacent or non overlapping features (or features with islands) in shapes
c) With Postgis and spatialite is still possible to merge non adjacent or non overlapping features (or features with islands), but actually in trunk (not in 1.3) it returns errors see #2187
Change History (3)
comment:1 by , 14 years ago
comment:2 by , 14 years ago
a) yes, it works now, but still c) (by the way spatialite seems already fixed, not postgis)
b) so, the bottom line is (please forgive me if I'm saying something stupid): if I have a polygon type shapefile I cannot merge non-adjacent features to obtain a multipolygon feature (just in qgis or is the general rule?), but if export that layer to postgis as multipolygon then I can merge non-adjacent features and export back to shapefile to obtain a multipolygon type one. Right?
I guess that this can be closed then.
comment:3 by , 14 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
I think r12340 makes everyone happy, disable a geometry type check for shapes (even if it is not good practice to have a polygon layer with multipolygons in it).
a) is a bug and should be fixed in r12327
b) is most likely in a polygon type layer (not multipolygon)? The merge of non-adjacent features would result in a multipolygon feature. And most datasources consequently reject multipolygons in polygon layers (e.g. postgis), while shape does not. The editing code cannot know if the datasource allows that or not, so it is rejected.
c) could be a problem that arises if (during commit), features are added before deleted .