gis
Database
Tables
(current)
Columns
Constraints
Relationships
Orphan Tables
Anomalies
Routines
get_id_voie
Parameters
Name
Type
Mode
pgeom
USER-DEFINED
IN
Definition
DECLARE idvoie integer; BEGIN SELECT leid into idvoie FROM( SELECT v.id_voie as leid, ST_Distance(pgeom, v.geom) as dist FROM adresse.voie v, adresse.commune com WHERE v.statut_voie_num IS FALSE AND ST_Intersects(pgeom, com.geom) AND ST_DWithin(v.geom, com.geom, 2000) ORDER BY dist LIMIT 1 ) AS d; RETURN idvoie; END;