GetEdgeByPoint — Busca el identificador de arista de una arista que cruza un punto determinado.
bigint GetEdgeByPoint(varchar atopology, geometry apoint, float8 tol1);
Recupera el identificador de una arista que cruza con un point.
La función devuelve un entero (identificador de borde) dada una topología, un POINT y una tolerancia. Si la tolerancia = 0 el punto tiene que intersectar el borde.
Si un apoint no intersecta una arista, devuelve 0 (cero).
If use tolerance > 0 and there is more than one edge near the point then an exception is thrown.
|
|
|
Si la tolerancia = 0, la función utiliza ST_Intersects de otra manera utiliza ST_DWithin. |
Realizado por el módulo GEOS.
Disponibilidad: 2.0.0
Estos ejemplos utilizan los bordes que hemos creado en 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