Name

GetEdgeByPoint — Finds the edge-id of an edge that intersects a given point.

Synopsis

integer GetEdgeByPoint(varchar atopology, geometry apoint, float8 tol1);

Descrição

Retrieves the id of an edge that intersects a Point.

A função retorna uma inteireza (id-limite) dada uma topologia, um PONTO e uma tolerância. Se tolerância = 0, o ponto tem que intersectar o limite.

If apoint doesn't intersect an edge, returns 0 (zero).

If use tolerance > 0 and there is more than one edge near the point then an exception is thrown.

[Note]

Se tolerância = 0, a função usa ST_Intersects, senão usa ST_DWithin.

Desempenhado pelo módulo GEOS.

Disponibilidade: 2.0.0

Exemplos

Estes exemplos utilizam limites que criamos em

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