gis
Database
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
calculate_apparaep_orientation
Parameters
Name
Type
Mode
idappaep
text
IN
Definition
DECLARE res double precision; BEGIN SELECT r.res into res FROM ( SELECT raepa.calcul_orientation(c.idcana, ST_LineLocatePoint(c.geom, p.geom)) as res, ST_Distance(c.geom, p.geom) as dist, ST_LineLocatePoint(c.geom, p.geom) as pos FROM raepa.raepa_apparaep_p p JOIN raepa.raepa_canalaep_l c ON ST_DWithin(c.geom, p.geom, 0.05) WHERE p.idappareil = idappaep ORDER BY dist, pos LIMIT 1) r; UPDATE raepa.raepa_apparaep_p ap SET _orientation = res WHERE ap.idappareil = idappaep; RETURN res; END;