Bug report #14006
Can't export layers from Postgis tables with Z component geometries
Status: | Closed | ||
---|---|---|---|
Priority: | Severe/Regression | ||
Assignee: | Hugo Mercier | ||
Category: | Data Provider/PostGIS | ||
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 |
Description
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),
geom geometry(MultiPolygonZ,4326)
);
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.
Associated revisions
History
#1 Updated by Pedro Venâncio almost 9 years ago
I can confirm this issue. Some information about it with sample data:
http://osgeo-org.1560.x6.nabble.com/Problem-editing-and-exporting-3D-Postgis-layers-td5240800.html
#2 Updated by Giovanni Manghi almost 9 years ago
is this a regression also compared to #12373 ?
#3 Updated by Hugo Mercier almost 9 years ago
Hi. There is a bug indeed. If I am correct, in 2.8 it converted the geometry to 2D before exporting ?
I may be because OGR does not handle 3D geometry correctly
#4 Updated by Nyall Dawson over 8 years ago
- Status changed from Open to Closed
Fixed in changeset 4e4743a2cd4d09e218a1335d8fde6b837e63c8b3.
#5 Updated by lire lire over 8 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.
#6 Updated by Nyall Dawson over 8 years ago
- Status changed from Reopened to Closed
@lire lire
Please open a new bug report about this - it is unrelated to the original closed report.