Name

ST_Dimension — The inherent dimension of this Geometry object, which must be less than or equal to the coordinate dimension.

Synopsis

integer ST_Dimension(geometry g);

Description

The inherent dimension of this Geometry object, which must be less than or equal to the coordinate dimension. OGC SPEC s2.1.1.1 - returns 0 for POINT, 1 for LINESTRING, 2 for POLYGON, and the largest dimension of the components of a GEOMETRYCOLLECTION.

This method implements the SQL/MM specification. SQL-MM 3: 5.1.2

Examples

SELECT ST_Dimension('GEOMETRYCOLLECTION(LINESTRING(1 1,0 0),POINT(0 0))');
ST_Dimension
-----------
1

See Also

ST_NDims