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 SQL
Databricks Runtime 17.1 and above
Important
This feature is in Public Preview.
Note
This feature is not available on Databricks SQL Classic warehouses. To learn more about Databricks SQL warehouses, see SQL warehouse types.
Returns the coordinate dimension of the input GEOGRAPHY or GEOMETRY value.
Syntax
st_ndims ( geoExpr )
Arguments
geoExpr: AGEOGRAPHYorGEOMETRYvalue.
Returns
A value of type INT, representing the coordinate dimension of the input GEOGRAPHY or GEOMETRY value.
The function returns NULL if the input is NULL.
Examples
-- Returns the number of dimensions of a 2D point geometry.
> SELECT st_ndims(st_geomfromtext('POINT(10 34)'));
2
-- Returns the number of dimensions of a 3D point geometry.
> SELECT st_ndims(st_geomfromgeojson('{"type":"Point","coordinates":[10,34,55]}'));
3
-- Returns the number of dimensions of a 3D point geography.
> SELECT st_ndims(st_geogfromtext('POINT M (10 34 48)'));
3
-- Returns the number of dimensions of a 4D point geography.
> SELECT st_ndims(st_geogfromtext('POINT ZM (10 34 48 -24)'));
4