Nota
El acceso a esta página requiere autorización. Puede intentar iniciar sesión o cambiar directorios.
El acceso a esta página requiere autorización. Puede intentar cambiar los directorios.
适用于: Databricks Runtime 17.1 及更高版本
重要
此功能目前以公共预览版提供。
返回 2D 投影的 GEOMETRY
拓扑维度。
语法
st_dimension ( geoExpr )
论据
-
geoExpr
:一个GEOMETRY
值。
退货
返回输入 GEOMETRY
的 2D 投影的拓扑维度。
表达式的结果是:
- 0,如果输入
GEOMETRY
是点或多点。 - 1,如果输入
GEOMETRY
是线字符串或多行字符串。 - 2,如果输入
GEOMETRY
是多边形或多多边形。 - 如果输入为空
GEOMETRY
集合,则为 0。 - 如果输入是非空几何图形集合,则为集合中元素的最大维度。
例子
> 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