I've installed QGIS 2.99 to test its new features, particularly the 3D viewer, when I try the following I only see a square, not a 3D cube.

In PostGIS I make a square and extrude it

-- make a square
CREATE TABLE public.square1
    id serial,
    geom geometry,
    CONSTRAINT square1_pkey PRIMARY KEY (id)

INSERT INTO public.square1 (geom)
SELECT ST_MakePolygon(ST_GeomFromText('LINESTRING (0 0, 0 100, 100 100, 100 0, 0 0)')) AS geom;

I add the following sql via the db manager and add as a layer.

ST_SetSRID(ST_Extrude(ST_Buffer(square1.geom, 0),0,0,10), 27700) AS geom
FROM Square1

But I only see 2D geometry, no 3D geometry. I had to set a srid, QGIS would not allow no projection or ESPG:4326

I test the polyhedral for its volume, this is correct

ST_volume(ST_Extrude(ST_Buffer(square1.geom, 0),0,0,10) ) AS volume
FROM Square1

Where have I gone wrong?


Did you enable the 3d renderer ? If not in each layer properties you have to go to the 3D View windows and check the box then set the appropriate parameters

enter image description here

  • I forgot that step! When it is enabled QGIS 2.99 crashes, I've reported it as a bug. Is there any other reason why a sql query via the database manager would cause this problem. I have checked the geometry, it is a polyhedral and the correct volume is calculated. – Spatial Digger Jan 24 '18 at 21:20
  • even using shapefile with z value the 3D viewer crash very often... – J.R Jan 25 '18 at 9:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.