拓扑访问器函数¶
GetEdgeByPoint¶
GetEdgeByPoint — 查找与给定点相交的边的边 ID。
参数¶
atopology
varchar类型。现有拓扑名
apoint
geometry类型。如果apoint与边不相交,返回0。
tol1
float8类型。如果使用的容差(tolerance)大于0,并且在某点附近存在多条边,则会引发异常。
返回值¶
返回值为 integer 类型。
示例¶
select topology.GetEdgeByPoint('schema_topo',ST_GeomFromText('POINT(5 5)'), 0::float8)::int = 4;
?COLUMN?(boolean) |
-----------------------
true |
总数目:1
GetFaceByPoint¶
GetFaceByPoint — 查找与给定点相交的面。
返回值¶
返回值为 integer 类型。
示例¶
select 't1', topology.GetFaceByPoint('schema_topo',ST_GeomFromText('POINT(7 7)'), 0::float8)::int;
?COLUMN?(varchar) |GETFACEBYPOINT(int) |
------------------------------------------------
t1 |4 |
总数目:1
GetNodeByPoint¶
GetNodeByPoint — 查找某个点位置处节点的节点 ID。
返回值¶
返回值为 integer 类型。
示例¶
select topology.GetNodeByPoint('schema_topo',ST_GeomFromText('POINT(5 5)'), 0::float8);
GETNODEBYPOINT(int) |
-------------------------
0 |
总数目:1
GetTopologyID¶
GetTopologyID — 返回topology.topology表中给定拓扑名称的拓扑的id。
返回值¶
返回值为 integer 类型。
示例¶
SELECT topology.GETTOPOLOGYID('GetTopology_test');
GETTOPOLOGYID(int) |
------------------------
1 |
总数目:1
GetTopologySRID¶
GetTopologySRID — 返回拓扑表中给定拓扑名称的拓扑的 SRID。
返回值¶
返回值为 integer 类型。
示例¶
SELECT topology.GetTopologySRID('GetTopology_test') As SRID;
SRID(int) |
---------------
4326 |
总数目:1
GetTopologyName¶
GetTopologyName — 返回给定拓扑 ID 的拓扑(架构)名称。
返回值¶
返回值为 integer 类型。
示例¶
SELECT topology.GETTOPOLOGYNAME(10);
GETTOPOLOGYNAME(varchar) |
------------------------------
null |
总数目:1
ST_GetFaceEdges¶
ST_GetFaceEdges — 返回一组有序的边,这些边界绑定了aface。
返回值¶
返回值为 GETFACEEDGES_RETURNTYPE 类型。
示例¶
SELECT '#3265.4', 0, topology.ST_GetFaceEdges('tt', 0);
?COLUMN?(varchar) |?COLUMN?(int) |ST_GETFACEEDGES(GETFACEEDGES_RETURNTYPE) |
----------------------------------------------------------------------------------------
#3265.4 |0 |(1,-1) |
----------------------------------------------------------------------------------------
#3265.4 |0 |(2,2) |
总数目:2
ST_GetFaceGeometry¶
ST_GetFaceGeometry — 返回给定拓扑中具有指定面 ID 的多边形。
返回值¶
返回值为 geometry 类型。
示例¶
SELECT 'f1 (with hole)', ST_asText(topology.st_getfacegeometry('tt', 1));
?COLUMN?(varchar) |ST_ASTEXT(text) |
--------------------------------------------
f1 (with hole) |POLYGON((0 0,0 10,10 |
|10,10 0,0 0),(2 2,8 |
|2,8 8,2 8,2 2)) |
总数目:1
GetRingEdges¶
GetRingEdges — 返回按顺序排列的边标识符集合,这些标识符是通过沿给定边的一侧行走时遇到的。
参数¶
atopology
varchar 类型。
aring
integer 类型。
max_edges
integer 类型。如果 max_edges 不为 null,则该函数返回的记录数不超过这些记录。 在处理可能无效的拓扑时,这是一个安全参数。
返回值¶
返回值为 GETFACEEDGES_RETURNTYPE 类型。
示例¶
select * from topology.GetRingEdges('city_data',1);
SEQUENCE(int) |EDGE(int) |
----------------------------------
1 |1 |
总数目:1