Calculates the volume of a closed 3D object represented as a meshgeom or sfmesh geometry. Returns NULL if the geometry is not closed or the input is invalid.
Syntax
float8 ST_Volume(meshgeom geom);
float8 ST_Volume(sfmesh sfmesh);Parameters
| Parameter | Description |
|---|---|
geom | The meshgeom object. |
sfmesh | The sfmesh object. |
Usage notes
The volume of a point, linestring, or polygon is
0.Returns
NULLifgeomis invalid.Returns
NULLif the 3D model is not closed.
Examples
select ST_Volume('MESHGEOM(PATCH(TRIANGLESTRIP Z(0 0 0,0 10 0,0 0 10,10 0 0,0 0 0), TRIANGLE Z( 0 0 0,0 10 0,10 0 0)))'::mesh);Output:
166.666666666667该文章对您有帮助吗?