Name

GetFaceByPoint — Finds face intersecting a given point.

Synopsis

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

Description

Finds a face referenced by a Point, with given tolerance.

The function will effectively look for a face intersecting a circle having the point as center and the tolerance as radius.

If no face intersects the given query location, 0 is returned (universal face).

If more than one face intersect the query location an exception is thrown.

Availability: 2.0.0

Enhanced: 3.2.0 more efficient implementation and clearer contract, stops working with invalid topologies.

Examples

SELECT topology.GetFaceByPoint('ma_topo',geom, 10) As with1mtol, topology.GetFaceByPoint('ma_topo',geom,0) As withnotol
	FROM ST_GeomFromEWKT('POINT(234604.6 899382.0)') As geom;

	 with1mtol | withnotol
	-----------+-----------
			 1 |         0
SELECT topology.GetFaceByPoint('ma_topo',geom, 1) As nearnode
	FROM ST_GeomFromEWKT('POINT(227591.9 893900.4)') As geom;

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