ValidateTopology

Name

ValidateTopology — Returns a set of validatetopology_returntype objects detailing issues with topology.

Synopsis

setof validatetopology_returntype ValidateTopology ( varchar toponame , geometry bbox ) ;

Description

Returns a set of validatetopology_returntype objects detailing issues with topology, optionally limiting the check to the area specified by the bbox parameter.

List of possible errors and what the returned ids represent are displayed below:

Error id1 id2
coincident nodes node_id null
edge crosses node edge_id node_id
invalid edge edge_id null
edge not simple edge_id null
edge crosses edge edge_id edge_id
edge start node geometry mis-match edge_id node_id
edge end node geometry mis-match edge_id node_id
face without edges face_id null
face has no rings face_id null
face has wrong mbr face_id null
hole not in advertised face signed edge_id identifying the ring null
not-isolated node has not-null containing_face node_id null
isolated node has null containing_face node_id null
isolated node has wrong containing_face node_id null
invalid next_right_edge edge_id null
invalid next_left_edge edge_id null
mixed face labeling in ring signed edge_id identifying the ring null
non-closed ring signed edge_id identifying the ring null
face has multiple shells face_id signed edge_id identifying the ring
face overlaps face face_id face_id
face within face inner face_id outer face_id
invalid next_left_edge edge_id expected next_left_edge value
invalid next_right_edge edge_id expected next_right_edge value

Availability: 1.0.0

Enhanced: 2.0.0 more efficient edge crossing detection and fixes for false positives that were existent in prior versions.

Changed: 2.2.0 values for id1 and id2 were swapped for 'edge crosses node' to be consistent with error description.

Changed: 3.2.0 added optional bbox parameter, perform face labeling and edge linking checks.

Examples

SELECT * FROM  topology.ValidateTopology('ma_topo');
      error        | id1 | id2
-------------------+-----+-----
face without edges |   1 |