7

I have a large road network that I'm using for routing and agent-based modelling and I've just noticed that it has a lot (possibly hundreds) of road segments that are not connected to the full network. I think this was because the road network was clipped to fit a county line that was a bit wiggly. My agent-based model places agents on road segments at random and when it places them on unattached road segments it fails.

Is there a way to highlight and remove all unattached road segments using QGIS or ArcGIS?

I've done some Googling and found info on 'dangles' but I've not been able to get the job done.

enter image description here

5

For QGIS, you could try the steps below. I used QGIS 2.12.3-Lyon and have a "road" line shapefile, the isolated road in the red circle is what we're trying to remove.

Unconnected road

  1. Intersect your layer on itself (Vector > Geoprocessing Tools > Intersect):

    Intersect

  2. Load the Spatial Query plugin (you may need to download/install this from Plugins > Manage and Install Plugins):

    Spatial Query

  3. Set the parameters for the Spatial Query to have your original line layer touch the intersected layer:

    Spatial Query options

  4. Run the plugin and when it's done, select the button to "Create layer with list of items":

    Results from Spatial Query

  5. The newly created layer should no longer have the isolated road.

    Final results

2

you could use "generate near table" with a small search radius. Values of -1 would mean that your road is far away from the network and should be removed. Values > 0 would mean that the road segment is not connect but that this could be automatically corrected by some edits/snapping tool.

2

I've no experience with QGIS or other GIS software but we automatically remove smaller 'islands' from the road network in GraphHopper via subnetwork detection.

It uses the tarjan algorithm, maybe you can apply that for QGIS somehow. Keep in mind that bad connectivity does not just mean missing arcs but could also mean that an island is connected and reachable but you cannot get out of the 'island' as there is only one 'bridge' and this is an oneway.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.