Skip to main content
Returns a double between 0 and 1, representing the location of the closest point on the LineString as a fraction of its total length. The first argument must be a LINESTRING, and the second argument is a POINT geometry. ST_LineLocatePoint

Signatures

ST_LineLocatePoint(linestring: Geometry, point: Geometry)

Parameters

linestring
Geometry
required
The linestring value.
point
Geometry
required
The point value.

Return type

A numeric value.

Example

SELECT ST_LineLocatePoint(ST_GeomFromWKT('LINESTRING(0 0, 1 1, 2 2)'), ST_GeomFromWKT('POINT(0 2)'))
0.5