I’ve recently been doing some work with town and city road networks in the UK using the Ordnance Survey ITN network dataset. For each town I have been using its boundary, as defined in the UK Census, as a “cookie cutter” for the network. Unfortunately this can lead to an untidy network:
- nodes without links (A below)
- links without end nodes (B below)
- disconnected “islands” (C below)
Problems A and B can be solved with the Topology Checker QGIS plugin. Once installed and opened the plugin allows you to set a number of rules for your layers. Different types of layers (point, line, polygon) have different relevant rules. In the example below, I have added two rules, one for my nodes and one for my links (edges).
The rule (1) for the links states that the end point of each link must be covered by a node. The rule (2) for the nodes states that each nodes mush be covered by the endpoint of a link.
When validation is performed the tool will list any breaking of the rules and more usefully will highlight any problems in the map window in red. You can then manually delete the problem nodes and links.
Unfortunately the Topology Checker has no way of identifying disconnected sub-graphs or “islands”. This can be done using the Disconnected Islands QGIS plugin. When run the plugin prompts you for your polyline layer and you are prompted for a tolerance and an attribute name. This attribute is added to your shapefile and adds a network number for each link, identifying the different separate networks in the layer.
As well as setting an attribute, the tool also highlights the disconnected islands, which can then be either removed or connected.