Bug report #14006
Can't export layers from Postgis tables with Z component geometries
|Affected QGIS version:||2.12.0||Regression?:||No|
|Operating System:||Easy fix?:||No|
|Pull Request or Patch supplied:||No||Resolution:|
|Crashes QGIS or corrupts data:||No||Copied to github as #:||22019|
In QGIS 2.12, having a layer from a Postgis table with Z component geometries, it's not possible to save as/export the data.
You can test it by creating the following table in Postgis:
CREATE TABLE test
gid serial primary key,
name character varying(100),
and inserting a record like the following example:
INSERT INTO test (name,geom) VALUES
('polygon 1 single flat', ST_GeomFromText('MultiPolygonZ (((-30.0 42.0 0, -30.0 41.0 0, -29.0 41.0 0, -29.0 42.0 0, -30.0 42.0 0)))',4326));
Open it in QGIS and try to save as. You will get the following error:
Export to vector file failed.
Error: Feature write errors:
Feature geometry not imported (OGR error: )
Only 0 of 1 features written.
This works well in QGIS 2.8.4, therefore I have set it as blocker.
#1 Updated by Pedro Venâncio over 4 years ago
I can confirm this issue. Some information about it with sample data:
#5 Updated by lire lire almost 4 years ago
- Status changed from Closed to Reopened
- Assignee changed from Jürgen Fischer to Hugo Mercier
In 2.14, features newly created by hand can be saved, but copying data from a layer without Z coordinate and pasting it into a PostGIS Z-layer leads upon saving to an "ERROR: Column has Z dimension but geometry does not" - the same as before.