GetEdgeByPoint — Trouve l'identifiant d'une arête qui coupe un point donné.
bigint GetEdgeByPoint(varchar atopology, geometry apoint, float8 tol1);
Récupère l'identifiant d'une arête qui coupe un point.
La fonction renvoie un entier (id-edge) à partir d'une topologie, d'un POINT et d'une tolérance. Si la tolérance = 0, le point doit couper l'arête.
Si apoint n'intersecte pas une arête, renvoie 0 (zéro).
Si la tolérance d'utilisation > 0 et qu'il y a plus d'une arête près du point, une exception est levée.
|
|
|
Si la tolérance = 0, la fonction utilise ST_Intersects, sinon elle utilise ST_DWithin. |
Effectué par le module GEOS.
Disponibilité : 2.0.0
Ces exemples utilisent les arêtes que nous avons créées dans AddEdge
SELECT topology.GetEdgeByPoint('ma_topo',geom, 1) As with1mtol, topology.GetEdgeByPoint('ma_topo',geom,0) As withnotol
FROM ST_GeomFromEWKT('SRID=26986;POINT(227622.6 893843)') As geom;
with1mtol | withnotol
-----------+-----------
2 | 0
SELECT topology.GetEdgeByPoint('ma_topo',geom, 1) As nearnode
FROM ST_GeomFromEWKT('SRID=26986;POINT(227591.9 893900.4)') As geom;
-- get error --
ERROR: Two or more edges found