AddEdge — 使用指定的線字串幾何,將線字串邊加入指定的拓樸架構的邊表,並將相關的起點和終點加入點節點表,並返回新(或現有)邊的邊ID。
integer AddEdge(
varchar toponame, geometry aline)
;
使用指定的線字串幾何,將邊加入指定的 toponame
架構的邊表,並將相關的節點加入節點表,並返回新或現有記錄的邊ID。新加入的邊在兩側都有「宇宙」面,並連結到自身。
![]() |
|
如果 |
![]() |
|
|
由 GEOS 模組執行。
![]() |
|
AddEdge 已於 3.5.0 版本起被棄用。請改用 TopoGeo_AddLineString。 |
可用性:2.0.0
SELECT topology.AddEdge('ma_topo', ST_GeomFromText('LINESTRING(227575.8 893917.2,227591.9 893900.4)', 26986) ) As edgeid; -- result- edgeid -------- 1 SELECT topology.AddEdge('ma_topo', ST_GeomFromText('LINESTRING(227591.9 893900.4,227622.6 893844.2,227641.6 893816.5, 227704.5 893778.5)', 26986) ) As edgeid; -- result -- edgeid -------- 2 SELECT topology.AddEdge('ma_topo', ST_GeomFromText('LINESTRING(227591.2 893900, 227591.9 893900.4, 227704.5 893778.5)', 26986) ) As edgeid; -- gives error -- ERROR: Edge intersects (not on endpoints) with existing edge 1