Topology ErrorTopology defines mathematical relationship between features in geographic region. It describes a spatial connection between objects like overlap, touches, cross, intersect, within, etc. Topology is very important to check a data free from errors. There are some errors that can be found in a dataset such as overlap, gap, sliver polygon, undershoot and overshoot.
Overlap is a topology error where a part or whole part of a feature occupies the same position with another feature. This become an error, because it is impossible for a feature to have same position with other. For example a parcel, it is not possible some part of it, is over another parcel.
Gap is a topology error which is opposite to overlap, where two adjacent features which share a common boundary, contains a blank area, which is no data. It is impossible for a parcel again which is neighbor with another parcel has no data area (blank area) around their common boundary.
Another topology error which can be found in polygon feature is sliver polygon. Sliver polygon happen where there is very small polygon along the common boundary. Or we could say when a gap is filled with polygon, then it becomes sliver polygon with a very small area. In figure 1 can be seen the illustration of these topology errors.
|Figure 1. Overlap, gap and sliver polygon topology error|
Undershoot is a topology error that can be found in line dataset which is a line is not touching another line segment. For example a road which is represented by a line must be connected with other line at road intersection.
Opposites to undershoot, overshoot is a topology error when a line touch another line but it passes the line with a very short length. So when we zooming in to the intersection, the line is not stop at the boundary, but it passes it a little bit. In figure 2 can be seen the illustration of overshoot and undershoot topology error.
|Figure 2. Overshoot and Undershoot topology error|
QGIS Topology Checker PluginChecking hundreds or even thousands features with topological error is tiring and time consuming. Because of that, we need a tool that can help us to check topology error. Topology Checker is a plugin in QGIS that can be used to check topology error. To use this plugin, make sure the topology checker plugin already installed. To install a plugin, click menu Plugins >> Manage and install plugins.. Then plugins window will appear as in figure 3. Type topology in search menu and topology checker plugin will be shown. Check the topology checker plugin and then push Install Plugin button.
|Figure 3. Installing Topology Checker Plugin|
If the plugin already installed, then lets see how to check topology error.
Checking Undershoot and Overshoot (Dangle) Topology ErrorFirstly we will check topology error for line feature. For this case I used road network dataset.
1. Add the road data to QGIS.
2. Open topology checker. You can use the topology checker's icon or access it from menu vector as in figure 4.
|Figure 4. Topology Checker Menu|
|Figure 5. Topology Checker Panel|
|Figure 6. Topology Rule Settings|
|Figure 7. Topology errors are marked with red marker|
|Figure 8. Dangle Error (Undershoot)|
Checking Polygon Topology ErrorWe have checked the error for line feature. Now lets move to polygon feature. We will check for topology error such as overlap and gap.
1. Add polygon layer to QGIS. For this tutorial I used building polygon.
2. Click Topology Checker plugin. In the panel click Configure. The Topology Rule Settings window will appear as in figure 6. Choose the layer and then select rule must not overlap and must not have gaps. We have to add each rule one by one. See figure 9.
|Figure 9. Topology Rule Settings for not overlap and gaps|
3. Click Validate, and then the error will appear and marked with red color as in figure 10.
Spatial IntegrityLast part of this tutorial we will talk about spatial integrity. What is spatial integrity? Spatial integrity is to make sure a data complies with the real condition as it is in the real world regarding with another data or features. To implement this spatial integrity we set the rule such as must contain, within, must not overlap with, must intersect with, etc. For example in the real world, a road can not be overlapped with building. If there is a road which is overlapped with building, it can not be accepted because it is not comply with the real condition.
For this tutorial I used two data, road network and building with the rule must not overlap with. For this case both layers must be in polygon.
1. Add Road network polygon and Building to QGIS.
2. In Topology Rule Settings window, select Road for the first layer, then select rule must not overlap with and select Building for the second layer. See figure 11.
|Figure 11.Topology Rule Settings for must not overlap with|
|Figure 12. Road which is overlapped with buildings are marked with red color|
|Figure 13. Zoom in to the overlap area|