Problem editing and exporting 3D Postgis layers

Previous Topic Next Topic
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

Problem editing and exporting 3D Postgis layers

Pedro Venâncio-2

There is a problem when trying to export 3D layers from PostGIS to shapefile, using "Save as..." of QGIS 2.12 and master. Tested with Pointz, PolygonZ, MultiPolygonZ, ... Always appears the following error:

Export to vector file failed.
Error: Feature write errors:
Feature geometry not imported (OGR error: )
Only 0 of 1 features written.

Despite the error, it creates a shapefile, but only the structure, without data, and a 2D shapefile.

The same operation (Save as...) with QGIS 2.8.4, works fine, but also converts the shapefile to 2D.

Making the export with ogr2ogr, works well and keeps the shapefile in 3D.

Save as... from a 3d shapefile to another shapefile, also works well on all QGIS versions, and keeps 3D geometry.

Another problem occurs when trying to edit those same 3D PostGIS layers.

With the layers in shapefile, everything works fine. Importing 3D shapes for PostGIS, works well. Edit these layers/geometries in Postgis, including moving geometries or vertex, editing attributes or the Z coordinate of the vertex (with the Node Tool) also works well.

But when trying to add a new feature, it can no longer write to the PostGIS, and this error show up:

Could not commit changes to layer point
Errors: ERROR: 1 feature(s) not added.
  Provider errors:
      PostGIS error while adding features: ERROR:  Column has Z dimension but geometry does not

Are these bugs? Could they be related? I am sending a sample 3D shapefile for tests ->
$ ogrinfo -al 3d_point.shp
INFO: Open of `3d_point.shp'
      using driver `ESRI Shapefile' successful.
Layer name: 3d_point
Geometry: 3D Point
Feature Count: 1
Extent: (36784.489088, 122737.827707) - (36784.489088, 122737.827707)
Layer SRS WKT:
FID: Real (11.0)
  FID (Real) = 0
  POINT (36784.489087541471235 122737.827706980169751 300)

I've tested both on Windows and Linux.

Best regards,
Pedro Venâncio

Qgis-developer mailing list
[hidden email]
List info:
Unsubscribe: (2K) Download Attachment