名前

ST_LineInterpolatePoints — ラインに沿って、割合で示された複数の位置の補間ポイントを返します。

概要

geometry ST_LineInterpolatePoints(geometry a_linestring, float8 a_fraction, boolean repeat);

説明

ラインに沿って、割合で示された位置の、一つ以上の補間ポイントを返します。一つ目の引数はLINESTRINGです。二つ目の引数は0から1の間の浮動小数点数で、ライン長に対するポイント間隔割合を表現します。三つ目の引数がFALSEの場合には、一つのポイントが構築されます (ST_LineInterpolatePointと同じです)。

結果にポイントが無いかポイントが一つだけの場合には、一つのPOINTを返します。二つ以上のポイントがある場合には、MULTIPOINTを返します。

Availability: 2.5.0

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

This function supports M coordinates.

ラインストリングの 20%ごとの補間

-- 2次元ラインに沿った20%ごとのポイントを返します。
SELECT ST_AsText(ST_LineInterpolatePoints('LINESTRING(25 50, 100 125, 150 190)', 0.20))
   st_astext
----------------
 MULTIPOINT(51.5974135047432 76.5974135047432,78.1948270094864 103.194827009486,104.132163186446 130.37181214238,127.066081593223 160.18590607119,150 190)

関連情報

ST_LineInterpolatePoint ST_LineLocatePoint