postgis calculate volume for pyramid

Viewed 52

Is it possible to compute the volume for pyramid> in postgis

enter image description here

SELECT 
    ST_Volume(ST_MakeSolid(geom)) 
  FROM (SELECT 'POLYHEDRALSURFACE
        ( 
            ((0 0 0, 0 1 0 , 1 0 0, 0 0 0)),
            ((0 0 0, 0 0 1, 0 1 0, 0 0 0)),
            ((0 0 0, 1 0 0, 0 0 1, 0 0 0)),
            ((1 0 0, 0 0 1, 0 1 0, 1 0 0))
        )
    ') As f(geom);

My error:

NOTICE: During volume(A) : NOTICE: with A: SOLID((((0/1 0/1 0/1,0/1 1/1 0/1,1/1 0/1 0/1,0/1 0/1 0/1)),((0/1 0/1 0/1,0/1 0/1 1/1,0/1 1/1 0/1,0/1 0/1 0/1)),((0/1 0/1 0/1,1/1 0/1 0/1,0/1 0/1 1/1,0/1 0/1 0/1)),((1/1 0/1 0/1,0/1 0/1 1/1,0/1 1/1 0/1,1/1 0/1 0/1))))

ERROR: Solid is invalid : PolyhedralSurface (shell) 0 is invalid: not connected : SOLID((((0/1 0/1 0/1,0/1 1/1 0/1,1/1 0/1 0/1,0/1 0/1 0/1)),((0/1 0/1 0/1,0/1 0/1 1/1,0/1 1/1 0/1,0/1 0/1 0/1)),((0/1 0/1 0/1,1/1 0/1 0/1,0/1 0/1 1/1,0/1 0/1 0/1)),((1/1 0/1 0/1,0/1 0/1 1/1,0/1 1/1 0/1,1/1 0/1 0/1)))) SQL state: XX000

0 Answers
Related