Name

GetNodeByPoint — Finds the node-id of a node at a point location.

Synopsis

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

Descrição

Retrieves the id of a node at a point location.

The function returns an integer (id-node) given a topology, a POINT and a tolerance. If tolerance = 0 means exact intersection, otherwise retrieves the node from an interval.

If apoint doesn't intersect a node, returns 0 (zero).

If use tolerance > 0 and there is more than one node 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.GetNodeByPoint('ma_topo',geom, 1) As nearnode
 FROM ST_GeomFromEWKT('SRID=26986;POINT(227591.9 893900.4)') As geom;
  nearnode
----------
        2
 
SELECT topology.GetNodeByPoint('ma_topo',geom, 1000) As too_much_tolerance
 FROM ST_GeomFromEWKT('SRID=26986;POINT(227591.9 893900.4)') As geom;

 ----get error--
 ERROR:  Two or more nodes found