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:

Errorid1id2
coincident nodesnode_idnull
edge crosses nodeedge_idnode_id
invalid edgeedge_idnull
edge not simpleedge_idnull
edge crosses edgeedge_idedge_id
edge start node geometry mis-matchedge_idnode_id
edge end node geometry mis-matchedge_idnode_id
face without edgesface_idnull
face has no ringsface_idnull
face has wrong mbrface_idnull
hole not in advertised facesigned edge_id identifying the ringnull
not-isolated node has not-null containing_facenode_idnull
isolated node has null containing_facenode_idnull
isolated node has wrong containing_facenode_idnull
invalid next_right_edgeedge_idnull
invalid next_left_edgeedge_idnull
mixed face labeling in ringsigned edge_id identifying the ringnull
non-closed ringsigned edge_id identifying the ringnull
face has multiple shellsface_idsigned edge_id identifying the ring
face overlaps faceface_idface_id
face within faceinner face_idouter face_id
invalid next_left_edgeedge_idexpected next_left_edge value
invalid next_right_edgeedge_idexpected 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 |
				

See Also

validatetopology_returntype, Topology_Load_Tiger