gis
Database
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
calcul_segment_proche
Parameters
Name
Type
Mode
ligne
USER-DEFINED
IN
pointc
USER-DEFINED
IN
Definition
DECLARE lageom geometry; BEGIN SELECT endgeom into lageom FROM ( SELECT ST_Distance(ST_MakeLine(St_PointN(ligne, n), St_PointN(ligne, n+1)), pointc) as dist, ST_MakeLine(St_PointN(ligne, n), St_PointN(ligne, n+1)) as endgeom FROM (SELECT generate_series(1, ST_NumPoints(ligne)-1) AS n) AS serie ORDER BY dist LIMIT 1) as finalgeom; RETURN lageom; END;