gis
Database
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
get_vanne_after_point
Parameters
Name
Type
Mode
cana_id
text
IN
locate_point
double precision
IN
all_v
boolean
IN
Definition
DECLARE locate double precision = 1; BEGIN WITH apploc as ( SELECT DISTINCT ON(c.idcana) c.idcana, ST_LineLocatePoint(c.geom, a.geom)- locate_point As dist_to_point, ST_LineLocatePoint(c.geom, a.geom) as loc FROM raepa.raepa_apparaep_p a INNER JOIN raepa.raepa_canalaep_l c ON ST_DWithin(c.geom, a.geom, 0.05) WHERE idcana = cana_id AND fnappaep = '03' AND (all_v or _ferme) AND ST_LineLocatePoint(c.geom, a.geom) - locate_point >= 0 ORDER BY c.idcana, dist_to_point ) SELECT loc into locate FROM apploc; return locate; END;