Compartir a través de

st_makepolygon 函数

适用于:已勾选“是”的 Databricks Runtime 17.1 及更高版本

重要

此功能目前以公共预览版提供。

从输入外部边界和内部边界的可选数组(表示为封闭线字符串)构造多边形 GEOMETRY

语法

st_makepolygon ( outer[, innerArray] )

论据

  • outer:一个 GEOMETRY 值。
  • innerArrayGEOMETRY值的数组。

退货

类型的 GEOMETRY值,表示多边形。

NULL将忽略内部边界数组中的任何值。

输出多边形的 SRID 值是输入几何图形的常见 SRID 值。

输出多边形的维度是输入线字符串的最大常见维度。

如果任何输入为NULL,该函数将返回NULL

错误条件

例子

-- Returns a polygon constructed from the outer boundary.
> SELECT st_astext(st_makepolygon(st_geomfromtext('LINESTRING(0 0,10 0,10 10,0 10,0 0)')));
  POLYGON((0 0,10 0,10 10,0 10,0 0))
-- Returns a polygon constructed from the outer boundary and an inner boundary.
> SELECT st_astext(st_makepolygon(st_geomfromtext('LINESTRING(0 0,10 0,10 10,0 10,0 0)'), array(st_geomfromtext('LINESTRING(1 1,2 1,1 2,1 1)'))));
  POLYGON((0 0,10 0,10 10,0 10,0 0),(1 1,2 1,1 2,1 1))