Bug report #15470

add part tool creates a MultiGeometry for CurvePolygon geometry type

Added by Tudor Bărăscu almost 8 years ago. Updated over 7 years ago.

Status:Closed
Priority:Normal
Assignee:Marco Hugentobler
Category:Data Provider/PostGIS
Affected QGIS version:2.16.1 Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:23396

Description

For a CurvePolygon geometry type column layer, using the add part tool works well if the geometry is NULL.
If the geometry is not null, it will add another part transforming the geometry into a multigeometry.
When trying to save:

Errors: ERROR: 1 geometries not changed.

  Provider errors:
      PostGIS error while changing geometry values: ERROR:  Geometry type (MultiSurface) does not match column type (CurvePolygon)

Tested under 2.16.1 and master under Debian testing.

History

#1 Updated by Tudor Bărăscu almost 8 years ago

Among the possible solutions could be:
- Disabling the add part tool when the geometry type is single geometry and the value is non null
- leaving that add part tool enabled but and output a message when it's clicked and output a message like: You cannot add a part to a geometry that's already filled and the type is single geometry

Thank you

#2 Updated by Jukka Rahkonen almost 8 years ago

But if the layer is a shapefile layer then it should work OK which means that situation is a bit more complicated.

#3 Updated by Tudor Bărăscu almost 8 years ago

Actually, the add part tool creates another part regardless of the underlying geometry type, which is wrong.
E.g. for a Point geometry if that geometry is not null, it creates another Point and transforms the whole geometry into MultiPoint but when the use tries to save there's the logical error: cannot save MultiPoint geometry into in Point geometry column.

#4 Updated by Tudor Bărăscu over 7 years ago

@Jukka, just tested for shapefiles and it's the same deal, if the shapefile geometry is single geometry (tested with point) it won't save but if it's multipoint it does.

I guess the best solution here would be to give a warning (as the user still can save the layer with the added part but in another format).

Later update:
Indeed it seems for Lines and Polygons it's as @Jukka mentioned.

#5 Updated by Tudor Bărăscu over 7 years ago

  • Status changed from Open to Closed

Should be mitigated with #e7c9b74afa96261cb1f3cc2c3c631a0a034420b3

Also available in: Atom PDF