A topology can be validated using the topology.ValidateTopology function. It takes one argument, the topology name. The computation is quite resource-hungry, so it can take some time to complete (but not as much as creating a topology from Simple Features takes).
The syntax for validating our topology is as follows:
SELECT topology.TopologySummary('my_topology');
After executing, if any errors are found, they are returned in a special composite type: validatetopology_returntype. This type consists of three parts:
- error, of type varchar, which contains a human-readable error message
- id1, of type integer, which contains the ID of the first problematic element
- id2, of type integer, which contains the ID of a second problematic element (if any)
Possible errors are as follows:
- Coincident nodes
- Edge crosses node
- Edge not simple
- Edge end node geometry mismatch
- Edge start node geometry mismatch
- Face overlaps face
- Face within face