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: PROJCS["ETRS89_Portugal_TM06", GEOGCS["GCS_ETRS_1989", DATUM["European_Terrestrial_Reference_System_1989", SPHEROID["GRS_1980",6378137,298.257222101]], PRIMEM["Greenwich",0], UNIT["Degree",0.017453292519943295]], PROJECTION["Transverse_Mercator"], PARAMETER["latitude_of_origin",39.66825833333333], PARAMETER["central_meridian",-8.133108333333334], PARAMETER["scale_factor",1], PARAMETER["false_easting",0], PARAMETER["false_northing",0], UNIT["Meter",1]] FID: Real (11.0) OGRFeature(3d_point):0 FID (Real) = 0 POINT (36784.489087541471235 122737.827706980169751 300)