[Qgis-developer] copy/paste: Z dimension in geometry

Denis Rouzaud denis.rouzaud at gmail.com
Thu Mar 13 00:16:59 PDT 2014


Hi all,

I recently modified the copy/paste mechanism in QGIS so geometries are 
automatically transformed to the destination layer geometry type.

Now, I have a problem when I copy features from a dxf to a postgis layer.

I get a PostGIS error saying the geometry has Z dimension while the 
layer has not.

This happens if no transformation occurs (e.g. both source and 
destination layers are single line) since the QgsGeometry::convertToType 
returns a copy of the given geometry.

Now, is there a better solution than returning 
QgsGeometry::fromPolyline(geom.asPolyline()) ?

Do you have any idea on how to solve this properly in the copy/paste 
mechanism in QGIS?

Or would it be an option: remove Z values from geometries in selected 
features?

Best regards,

Denis


More information about the Qgis-developer mailing list