次の方法で共有


st_makepolygon 関数

適用対象:はい Databricks SQL チェックが Databricks Runtime 17.1 以降" とマークされているチェック

Important

この機能は パブリック プレビュー段階です

この機能は、Databricks SQL クラシック ウェアハウスでは使用できません。 Databricks SQL ウェアハウスの詳細については、 SQL ウェアハウスの種類に関するページを参照してください。

入力外部境界と、閉じたライン文字列として表される内部境界の省略可能な配列から、多角形の GEOMETRY 値を構築します。

Syntax

st_makepolygon ( outer[, innerArray] )

Arguments

  • outer: GEOMETRY 値。
  • innerArray: GEOMETRY 値の配列。

Returns

多角形を表す GEOMETRY型の値。

内部境界配列内の NULL 値はすべて無視されます。

出力ポリゴンの SRID 値は、入力ジオメトリの共通 SRID 値です。

出力ポリゴンの次元は、入力ラインストリングの最大共通次元です。

いずれかの入力がNULLされている場合、関数はNULLを返します。

エラー条件

Examples

-- 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))