Bug report #12010
Can edit Z geom but fail to create it
|Affected QGIS version:||2.6.1||Regression?:||No|
|Operating System:||Windows||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:||end of life|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||20213|
Version of qgis is 2.6.1 on windows 64.
The bug is pretty simple.
Creating a 3D table in postgis, it is possible to edit the 3D geom, but we get an errro when trying to create a new geometry.
SELECT 1::int AS gid, ST_GeomFRomText('LinestringZ(0 0 0 , 1 1 1, 2 2 2 )',4326)::geometry(linestringZ,4326) AS geom;
Then loading this layer in qgis.
It is possible to edit the geometry
(inserted vertex have 0 Z by the way, it could be interpolated lineary at least).
But when trying to create a new geometry : ERROR : "Column has Z dimension but geometry does not"
#1 Updated by Tudor Bărăscu almost 5 years ago
I also encountered this problem in the latest master (2.11).
As QGIS editing tools don't created (currently) 3D features, one solution would be to have triggers that take the 2d line created by QGIS and transform it into a 3d line by reading another attribute column(s) that have z data values.
However, the default way of creating geometry columns in a Postgis database is using type modifier since postgis 2.0.
This gets in the way of the triggers as the geometry constraints are checked before any trigger is run.
But if the geometry column is created using the old check constraints behavior, see http://postgis.net/docs/AddGeometryColumn.html, like this..
SELECT AddGeometryColumn ('schema_name','table_name','geometry_column',SRID,'LINESTRING',3, false);
and if you have a trigger that forces the geometry in 3d (
NEW.geometry := ST_Force3D(NEW.geometry);then it will work.
All the best
#7 Updated by Giovanni Manghi over 1 year ago
- Resolution set to end of life
- Status changed from Open to Closed
End of life notice: QGIS 2.18 LTR