Name

ST_Project_Point — Finds the closest point from a Line to a given point

Synopsis

geometry ST_Project_Point(bytea Line, bytea Point);

Alias

Project_Point

Description

Finds the closest point from a Line to a given point.

[Note]

ST_Project_Point (Line, Point) is a shortening of ST_Line_Interpolate_Point(line,ST_Line_Locate_Point(line,point))

Coordinate Dimensions
2D3DM
Spatial Standards Support
OGC SFS for SQL. 1.1 (1999)OGC SFS for SQL. 1.1.0 (2005)OGC SFS for SQL. 1.2.0 (2006)SQL-MM Part 3
----

Examples

SELECT ST_AsText(ST_Project_Point(line,point)) as interpolate 
FROM (SELECT ST_GeomFromText('LINESTRING (10 11, 15 26, 29 35)') as line, 
      ST_GeomFromText('POINT (27 27)') as point) as foo;

--Result
                  interpolate
-----------------------------------------------
 POINT (23.945848375451263 31.750902527075812)
(1 row)

Related functions

ST_Line_Interpolate_Point,ST_Line_Locate_Point