GetNodeByPoint — 尋找位於點位置的節點 ID。
integer GetNodeByPoint(
varchar atopology, geometry apoint, float8 tol1)
;
檢索位於點位置的節點 ID。
此函數會根據拓樸、POINT 和容差值傳回整數 (節點 ID)。如果容差值 = 0 表示精確相交,否則會從間隔中檢索節點。
如果 apoint
沒有與節點相交,則傳回 0 (零)。
如果使用容差值 > 0 且該點附近有多個節點,則會拋出例外。
![]() |
|
如果容差值 = 0,此函數會使用 ST_Intersects,否則會使用 ST_DWithin。 |
由 GEOS 模組執行。
可用性:2.0.0
這些範例使用我們在 AddEdge 中建立的邊。
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