名前

ST_LocateBetween — M値の範囲に合致する部分ジオメトリを返します。

概要

geometry ST_LocateBetween(geometry geom, float8 measure_start, float8 measure_end, float8 offset = 0);

説明

指定された範囲のM値を持つ入力ジオメトリの部分ジオメトリとなるジオメトリ (コレクション)を全て返します。

offsetが与えられた場合には、結果は、入力ラインの左または右に、指定された距離だけ移動します。正のオフセット値で左に、負の値で右にそれぞれ移動します。

凸でないPOLYGONを抜き出すと不正なジオメトリを返すことがあります。

ISO/IEC 13249-3 SQL/MM 空間標準で規定されているため、このような意味になります。

Availability: 1.1.0 それより前はST_Locate_Between_Measuresでした。

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

Enhanced: 3.0.0 - POLYGON, TIN, TRIANGLEへの対応が追加されました。

この関数はM値に対応します。

このメソッドはSQL/MM仕様の実装です。 SQL-MM IEC 13249-3: 5.1

Code
SELECT ST_LocateBetween(
'MULTILINESTRING M ((1 2 3,3 4 2,9 4 3),(1 2 3,5 4 5))'::geometry,
1.5,
3);
出力:
GEOMETRYCOLLECTION M (LINESTRING M (1 2 3,3 4 2,9 4 3),POINT M (1 2 3))
Figure
Geometry figure for visual-st-locatebetween-01

Extract the section between measures 2 and 8, offset to the left. Because the clipped line and the offset result share the same coordinate space, this example is intended for a single overlay panel rather than separate side-by-side figures.

Code
SELECT ST_LocateBetween(
ST_AddMeasure(
    'LINESTRING (20 180,50 20,100 120,180 20)',
    0,
    10),
2,
8,
20);
出力:
MULTILINESTRING((54.49835 104.53427,58.700561 82.122481,82.111456 128.944272,84.248937 132.324934,87.01637 135.21267,90.303073 137.491987,93.977598 139.071724,97.892984 139.888702,101.892639 139.910247,105.816599 139.135495,109.507928 137.595434,112.818995 135.351657,115.617376 132.493901,145.310173 95.377905))
Figure
Geometry figure for visual-st-locatebetween-02