首頁
云原生數據庫 PolarDB
云原生數據庫PolarDB PostgreSQL版(兼容Oracle)
時空引擎(GanosBase)
Geometry SQL參考
線性參考
ST_LineLocatePoint
返回介于0和1之間的浮點數,表示LineString上與給定Point點最接近的點在其總長度的位置。
語法
float8 ST_LineLocatePoint(geometry aLinestring , geometry aPoint);
float8 ST_LineLocatePoint(geography aLinestring , geography aPoint);
參數
參數名稱 | 描述 |
aLinestring | 目標LineString對象。 |
aPoint | 目標Point對象。 |
描述
該函數在估算地址數量時很有用。
示例
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)
文檔內容是否對您有幫助?