Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to: Databricks Runtime 17.1 and above
Important
This feature is in Public Preview.
Returns the topological dimension of the 2D projection of the GEOMETRY
.
Syntax
st_dimension ( geoExpr )
Arguments
geoExpr
: AGEOMETRY
value.
Returns
Returns the topological dimension of the 2D projection of the input GEOMETRY
.
The expression returns:
- 0, if the input
GEOMETRY
is a point or a multipoint. - 1, if the input
GEOMETRY
is a linestring or a multilinestring. - 2, if the input
GEOMETRY
is a polygon or a multipolygon. - 0, if the input is an empty
GEOMETRY
collection. - The maximum dimension of elements of the collection, if the input is a non-empty geometry collection.
Examples
> SELECT st_dimension(st_geomfromtext('MULTIPOINT(EMPTY,-1 0,EMPTY)'))
0
> SELECT st_dimension(st_geomfromtext('LINESTRING(-1 0,0 -1,1 0,0 1,-1 0)'))
1
> SELECT st_dimension(st_geomfromtext('MULTIPOLYGON(EMPTY,((-1 0,0 -1,1 0,0 1,-1 0)))'))
2
> SELECT st_dimension(st_geomfromtext('GEOMETRYCOLLECTION EMPTY'))
0