Name

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

Synopsis

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

Descrizione

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]

If tolerance = 0, the function uses ST_Intersects otherwise uses ST_DWithin.

Eseguito dal modulo GEOS.

Disponibilità: 2.0.0

Esempi

These examples use edges we created in AddEdge

SELECT topology.GetNodeByPoint('ma_topo', geom, 1) As nearnode
FROM ST_GeomFromEWKT('SRID=26986;POINT(227591.9 893900.4)') As geom;
2

This query errors because the tolerance matches two or more nodes.

SELECT topology.GetNodeByPoint('ma_topo', geom, 1000) As too_much_tolerance
FROM ST_GeomFromEWKT('SRID=26986;POINT(227591.9 893900.4)') As geom;
ERROR:  Two or more nodes found