PostGIS 3.5 Topology Cheatsheet

New in this release 1Enhanced in this release 2   Requires GEOS (3.9,3.10,3.11,3.12) or higher g3.9  
지형 유형
getfaceedges_returntype    A composite type that consists of a sequence number and an edge number.
TopoGeometry    A composite type representing a topologically defined geometry.
validatetopology_returntype    A composite type that consists of an error message and id1 and id2 to denote location of error. This is the return type for ValidateTopology.

지형 도메인
TopoElement    일반적으로 TopoGeometry 구성 요소를 식별하는 데 쓰이는 정수형 2개의 배열입니다.
TopoElementArray    An array of TopoElement objects.

지형 및 TopoGeometry 관리
AddTopoGeometryColumn    기존 테이블에 TopoGeometry 열을 추가하고, topology.layer에 이 새 열을 레이어로 추가하며, 새 layer_id를 반환합니다.
  1. topology_name, schema_name, table_name, column_name, feature_type
  2. topology_name, schema_name, table_name, column_name, feature_type, child_layer
RenameTopoGeometryColumn (layer_table, feature_column, new_name)    Renames a topogeometry column
DropTopology (topology_schema_name)    이용에 주의하십시오: 지형 스키마를 삭제하고 topology.topology 테이블에서 해당 참조를, 그리고 geometry_columns 테이블에서 해당 스키마에 있는 테이블의 참조를 삭제합니다.
RenameTopology (old_name, new_name)    Renames a topology
DropTopoGeometryColumn (schema_name, table_name, column_name)    schema_name 스키마 안의 table_name 명칭의 테이블에서 Topogeometry 열을 삭제하고 topology.layer 테이블에서 해당 열을 등록 해제합니다.
Populate_Topology_Layer ()    Adds missing entries to topology.layer table by reading metadata from topo tables.
TopologySummary (topology_schema_name)    Takes a topology name and provides summary totals of types of objects in topology.
ValidateTopology (toponame, bbox)    Returns a set of validatetopology_returntype objects detailing issues with topology.
ValidateTopologyRelation (toponame)    Returns info about invalid topology relation records
FindTopology    Returns a topology record by different means.
  1. topogeom
  2. layerTable, layerColumn
  3. layerSchema, layerTable, layerColumn
  4. topoName
  5. id
FindLayer    Returns a topology.layer record by different means.
  1. tg
  2. layer_table, feature_column
  3. schema_name, table_name, feature_column
  4. topology_id, layer_id

Topology Statistics Management

지형 작성자
CreateTopology    Creates a new topology schema and registers it in the topology.topology table.
  1. topology_schema_name
  2. topology_schema_name, srid
  3. topology_schema_name, srid, prec
  4. topology_schema_name, srid, prec, hasz
CopyTopology (existing_topology_name, new_name)    Makes a copy of a topology (nodes, edges, faces, layers and TopoGeometries) into a new schema
ST_InitTopoGeo  mm (topology_schema_name)    Creates a new topology schema and registers it in the topology.topology table.
ST_CreateTopoGeo  mm (atopology, acollection)    텅 빈 입력 지형에 도형들의 집합을 추가한 다음 작업 성공 여부를 상세하게 설명하는 메시지를 반환합니다.
TopoGeo_AddPoint (atopology, apoint, tolerance)    허용 오차를 이용해서 그리고 기존 경계선을 분할(split)하기도 해서 기존 지형에 포인트를 추가합니다.
TopoGeo_AddLineString (atopology, aline, tolerance)    Adds a linestring to an existing topology using a tolerance and possibly splitting existing edges/faces. Returns edge identifiers.
TopoGeo_AddPolygon (atopology, apoly, tolerance)    Adds a polygon to an existing topology using a tolerance and possibly splitting existing edges/faces. Returns face identifiers.
TopoGeo_LoadGeometry  1 (atopology, ageom, tolerance)    Load a geometry into an existing topology, snapping and splitting as needed.

지형 편집자
ST_AddIsoNode  mm (atopology, aface, apoint)    지형 안의 표면에 고립된(isolated) 노드를 추가하고 새 노드의 ID를 반환합니다. 표면이 NULL일 경우, 그래도 노드를 생성합니다.
ST_AddIsoEdge  mm (atopology, anode, anothernode, alinestring)    지형에 두 개의 고립된 기존 노드 anode 와 anothernode 를 연결하는 alinestring 도형이 정의하는 고립된 경계선을 추가하고 새 경계선의 ID를 반환합니다.
ST_AddEdgeNewFaces  mm (atopology, anode, anothernode, acurve)    새 경계선을 추가하고, 그 과정에서 경계선이 표면을 분할할 경우, 원본 표면을 삭제하고 새 표면 2개로 교체합니다.
ST_AddEdgeModFace  mm (atopology, anode, anothernode, acurve)    새 경계선을 추가하고, 그 과정에서 경계선이 표면을 분할할 경우, 원본 표면을 수정하고 새 표면을 추가합니다.
ST_RemEdgeNewFace  mm (atopology, anedge)    경계선을 제거하고, 제거한 경계선이 두 표면을 분할하고 있을 경우, 원본 표면들을 삭제하고 새 표면 하나로 대체합니다.
ST_RemEdgeModFace  mm (atopology, anedge)    Removes an edge, and if the edge separates two faces deletes one face and modifies the other face to cover the space of both.
ST_ChangeEdgeGeom  mm (atopology, anedge, acurve)    지형 구조를 건드리는 일 없이 경계선의 형상을 변경합니다.
ST_ModEdgeSplit  mm (atopology, anedge, apoint)    기존 경계선을 따라 새 노드를 추가한 다음, 원본 경계선을 수정하고 새 경계선을 추가해서 경계선을 분할합니다.
ST_ModEdgeHeal  mm (atopology, anedge, anotheredge)    Heals two edges by deleting the node connecting them, modifying the first edge and deleting the second edge. Returns the id of the deleted node.
ST_NewEdgeHeal  mm (atopology, anedge, anotheredge)    Heals two edges by deleting the node connecting them, deleting both edges, and replacing them with an edge whose direction is the same as the first edge provided.
ST_MoveIsoNode  mm (atopology, anode, apoint)    Moves an isolated node in a topology from one point to another. If new apoint geometry exists as a node an error is thrown. Returns description of move.
ST_NewEdgesSplit  mm (atopology, anedge, apoint)    기존 경계선을 따라 새 노드를 추가한 다음, 원본 경계선을 삭제하고 새 경계선 2개로 교체해서 경계선을 분할합니다. 새 경계선들을 결합하는 새로 생성된 노드의 ID를 반환합니다.
ST_RemoveIsoNode  mm (atopology, anode)    고립된 노드를 제거하고 작업 내용을 설명하는 메시지를 반환합니다. 노드가 고립되지 않은 (경계선의 시작점이나 종단점인) 경우, 예외가 발생합니다.
ST_RemoveIsoEdge  mm (atopology, anedge)    Removes an isolated edge and returns description of action. If the edge is not isolated, then an exception is thrown.

지형 접근자
GetEdgeByPoint (atopology, apoint, tol1)    Finds the edge-id of an edge that intersects a given point.
GetFaceByPoint (atopology, apoint, tol1)    Finds face intersecting a given point.
GetFaceContainingPoint (atopology, apoint)    Finds the face containing a point.
GetNodeByPoint (atopology, apoint, tol1)    Finds the node-id of a node at a point location.
GetTopologyID (toponame)    지형의 명칭을 입력받아 topology.topology 테이블에 있는 지형의 ID를 반환합니다.
GetTopologySRID (toponame)    지형의 명칭을 입력받아 topology.topology 테이블에 있는 지형의 SRID를 반환합니다.
GetTopologyName (topology_id)    지형의 ID를 입력받아 지형(스키마)의 명칭을 반환합니다.
ST_GetFaceEdges  mm (atopology, aface)    aface 의 경계를 이루는 정렬된 경계선들의 집합을 반환합니다.
ST_GetFaceGeometry  mm (atopology, aface)    입력 지형으로부터 설정된 표면 ID를 가진 폴리곤을 반환합니다.
GetRingEdges (atopology, aring, max_edges=null)    입력 경계선 쪽을 따라 탐색한 부호가 있는 경계선 식별자들의 정렬된 집합을 반환합니다.
GetNodeEdges (atopology, anode)    입력 노드를 따르는 경계선들의 정렬된 집합을 반환합니다.

지형 공간 처리
Polygonize (toponame)    Finds and registers all faces defined by topology edges.
AddNode (toponame, apoint, allowEdgeSplitting=false, computeContainingFace=false)    설정한 지형 스키마의 노드 테이블에 포인트 노드를 추가하고 새 노드의 노드 ID(nodeid)를 반환합니다. 새 포인트 위치에 이미 노드가 존재할 경우, 기존 노드 ID를 반환합니다.
AddEdge (toponame, aline)    설정한 지형 스키마의 경계선 테이블에 라인스트링 경계선을 추가하고, 설정한 라인스트링 도형을 이용해서 포인트 노드 테이블에 경계선의 시작점 및 종단점을 추가한 다음 새 (또는 기존) 경계선의 경계선 ID(edgeid)를 반환합니다.
AddFace (toponame, apolygon, force_new=false)    지형에 표면 원시형(face primitive)을 등록하고 그 식별자를 반환합니다.
ST_Simplify (tg, tolerance)    더글러스-패커(Douglas-Peucker) 알고리즘을 통해 입력 TopoGeometry 의 "단순화된" 도형 버전을 반환합니다.
RemoveUnusedPrimitives (topology_name, bbox)    Removes topology primitives which not needed to define existing TopoGeometry objects.

TopoGeometry 작성자
CreateTopoGeom    지형 요소 배열로부터 새 지형 도형 객체를 생성합니다. tg_type은 1: [멀티]포인트, 2: [멀티]라인, 3: [멀티]폴리곤, 4: 도형 집합입니다.
  1. toponame, tg_type, layer_id, tg_objs
  2. toponame, tg_type, layer_id
toTopoGeom    Converts a simple Geometry into a topo geometry.
  1. geom, toponame, layer_id, tolerance
  2. geom, topogeom, tolerance
TopoElementArray_Agg (tefield)    Returns a topoelementarray for a set of element_id, type arrays (topoelements).
TopoElement (topo)    Converts a topogeometry to a topoelement.

TopoGeometry 편집자
clearTopoGeom (topogeom)    Clears the content of a topo geometry.
TopoGeom_addElement (tg, el)    Adds an element to the definition of a TopoGeometry.
TopoGeom_remElement (tg, el)    Removes an element from the definition of a TopoGeometry.
TopoGeom_addTopoGeom (tgt, src)    Adds element of a TopoGeometry to the definition of another TopoGeometry.
toTopoGeom    Adds a geometry shape to an existing topo geometry.

TopoGeometry 접근자
GetTopoGeomElementArray    Returns a topoelementarray (an array of topoelements) containing the topological elements and type of the given TopoGeometry (primitive elements).
  1. toponame, layer_id, tg_id
  2. tg
GetTopoGeomElements    Returns a set of topoelement objects containing the topological element_id,element_type of the given TopoGeometry (primitive elements).
  1. toponame, layer_id, tg_id
  2. tg
ST_SRID  mm (tg)    Returns the spatial reference identifier for a topogeometry.

TopoGeometry 출력물
AsGML    TopoGeometry의 GML 표현식을 반환합니다.
  1. tg
  2. tg, nsprefix_in
  3. tg, visitedTable
  4. tg, visitedTable, nsprefix
  5. tg, nsprefix_in, precision, options
  6. tg, nsprefix_in, precision, options, visitedTable
  7. tg, nsprefix_in, precision, options, visitedTable, idprefix
  8. tg, nsprefix_in, precision, options, visitedTable, idprefix, gmlversion
AsTopoJSON (tg, edgeMapTable)    TopoGeometry의 TopoJSON 표현식을 반환합니다.

지형 공간 관계성
Equals  3d (tg1, tg2)    두 TopoGeometry가 동일한 지형 원시형으로 이루어졌을 경우 참을 반환합니다.
Intersects  3d (tg1, tg2)    두 TopoGeometry에서 나온 원시형의 쌍 가운데 하나라도 교차할 경우 참을 반환합니다.

Importing and exporting Topologies