すべてのプロダクト
Search
ドキュメントセンター

PolarDB:ST_LineLocatePoint

最終更新日:Sep 26, 2024

このトピックでは、ST_LineLocatePoint関数について説明します。 この関数は、LineStringオブジェクトの全長とは対照的に、LineStringオブジェクト内の最も近い点の位置を表す0 ~ 1の範囲内の浮動小数点数を返します。

構文

float8  ST_LineLocatePoint(geometry  aLinestring , geometry  aPoint);
float8  ST_LineLocatePoint(geography  aLinestring , geography  aPoint);

パラメーター

パラメーター

説明

aLinestring

LineStringオブジェクト。

aPoint

ポイントオブジェクト。

説明

この関数は、アドレスの数を推定するために使用できます。

SELECT ST_LineLocatePoint('LINESTRING(0 0,0 2)'::geometry, 'POINT(1 1)'::geometry);
 st_linelocatepoint
--------------------
                0.5
(1 row)

-- geography
SELECT ST_LineLocatePoint('LINESTRING(0 0,0 2)'::geography, 'POINT(1 1)'::geography);
 st_linelocatepoint 
--------------------
 0.5000746195163556
(1 row)