名前

ST_3DExtent — 複数のジオメトリの行の境界とな3次元バウンディングボックスを返す集約関数。

概要

box3d ST_3DExtent(geometry set geomfield);

説明

ST_3DExtentはジオメトリの集合を囲むbox3d (Z座標を含む)のバウンディングボックスを返します。ST_Extentは、PostgreSQL用語で言うところの「集約関数」です。SUM()やMEAN()と同じ方法でデータリストの操作を行うことを意味します。

バウンディングボックスを返しますが、空間単位はSRIDで示された空間参照系の単位です。

[注記]

ST_3DExtentはバウンディングボックスを返しますが、SRIDメタデータは失います。ST_SetSRIDを使って、SRIDメタデータをジオメトリに強制的に戻します。座標値の単位は元のジオメトリの空間参照系の単位です。

Enhanced: 2.0.0 多面体サーフェス対応、三角対応、TIN対応が導入されました。

Changed: 2.0.0 以前の版ではST_Extent3Dと呼ばれていました。

This function supports 3d and will not drop the z-index.

This method supports Circular Strings and Curves

This function supports Polyhedral surfaces.

This function supports Triangles and Triangulated Irregular Network Surfaces (TIN).

SELECT ST_3DExtent(foo.the_geom) As b3extent
FROM (SELECT ST_MakePoint(x,y,z) As the_geom
        FROM generate_series(1,3) As x
                CROSS JOIN generate_series(1,2) As y
                CROSS JOIN generate_series(0,2) As Z) As foo;
          b3extent
--------------------
 BOX3D(1 1 0,3 2 2)

-- 様々な高度を持つ曲線ストリングの範囲を得ます
SELECT ST_3DExtent(foo.the_geom) As b3extent
FROM (SELECT ST_Translate(ST_Force_3DZ(ST_LineToCurve(ST_Buffer(ST_MakePoint(x,y),1))),0,0,z) As the_geom
        FROM generate_series(1,3) As x
                CROSS JOIN generate_series(1,2) As y
                CROSS JOIN generate_series(0,2) As Z) As foo;

        b3extent
--------------------
 BOX3D(1 0 0,4 2 2)
                

関連情報

ST_Extent, ST_Force3DZ