GetFaceByPoint — 尋找與給定點相交的面。
integer GetFaceByPoint(
varchar atopology, geometry apoint, float8 tol1)
;
尋找由點參照,且具有給定容差的面。
此函數實際上會尋找與以該點為中心,容差為半徑的圓相交的面。
如果沒有面與給定的查詢位置相交,則返回 0(通用面)。
如果有多個面與查詢位置相交,則會拋出例外。
可用性:2.0.0
增強功能:3.2.0 更有效率的實作和更清晰的合約,停止使用無效的拓樸。
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