5

I'm trying to perform an OD Cost Matrix calculation on a set of points using a road network from OpenStreetMap data. The network contains lots of roads that don't connect to the rest of the network. In the case where a point snaps to such a place on the network, it can't reach any other sample points.

How do I remove these sections of road? Or if that's not possible, how could I systematically identify those areas and connect them to the rest of the network?

2
  • Would you be able to edit your Question to include a picture of what your data looks like? Also, what version of ArcGIS for Desktop are you using, and is your data stored in a file geodatabase or something else?
    – PolyGeo
    Apr 7, 2014 at 1:52
  • 1
    Disconnected line segments are difficult to spot in the vector model ArcGis uses; when ESRI was using coverages they were easy to find (DrawEnvironment Node Dangle). I have found disconnected end points using feature vertices to points with both end option and then event rendering to compile end counts. The unattached ends have a count of 1 I exported then joined to the lines - any that had both ends with a count of 1 are isolated. This will only work if the lines are planar (i.e. end-on-end). Apr 7, 2014 at 3:19

2 Answers 2

6

My solution to this was kind of a kludge, but then I was doing a small class project working with a subset of one county's roads so the network wasn't that big and I didn't need to do it as a common task. I just ran a service area analysis with the time set large enough that in theory everything should be reachable. That highlighted everything that was connected, thereby showing what wasn't. Some of them I added new connections because I needed to preserve those areas, others I simply selected and deleted the isolated roads from the dataset.

10.1 help has reference to a Find Disconnected tool on the Utility Network Analyst Toolbar if you have access to that.

10.2.1 also has a new tool that might do what you want, if you have access to that version or higher: Find Disconnected Features In Geometric Network (Data Management)

1
  • Large enough time for service area solved my problem! thanks! +1
    – Red
    Jun 17, 2017 at 20:26
3

I was looking for a possibility to delete isolated lines from OSM data, too. Unfortunately, I have a huge amount of data. And having to deal with Network Datasets anyway, I just didnt want to examine Geometric Networks. But using Michaels suggestion worked, thank you very much! I had to change 2 things: First, I had to unsplit the lines in the beginning, so that I was been able to delete also isolated parts that consists of more than 1 feature line. Second, the last step consists of a query to the lines with a joinCount of 2 (istead of a iCount of 1). My data is preprocessed OSM data, stored in a file geodatabase. Here are the detailed steps:

  1. Make a copy of the roads dataset -> roads_copy
  2. Use "unsplit line" tool on roads_copy -> roads_unsplit
  3. Use "feature vertices to points" tool on roads_unsplit (point type: both ends) -> roads_vert
  4. Use "collect events with rendering" tool on roads_vert (quite time intensive) -> roads_collect (unattached ends get ICOUNT = 1)
  5. Query roads_collect: "Select from roads_collect where ICOUNT = 1"
  6. Export query result -> roads_icount1
  7. Use "spatial join" tool to join roads_icount1 (= join features) to roads_unsplit (= target features); choose "one_to_one", "keep all target features" and "intersect" -> roads_join (isolated roads get Join_Count = 2)
  8. Query roads_join: "Select from roads_join where Join_Count = 2"
  9. Use "select layer by location" on original (not unsplitted!) roads; selecting features = roads_join, relationship = "share_a_line_segment_with", selection type = "new_selection"
  10. Delete selected rows using "delete rows" tool

There you go. Maybe put it in a model. It seems a little complicated but leads to the desired result for me.

1
  • I followed AriJane's method and it worked, however, some false positives will be returned if line 'a' connects to the vertex of line 'b' (such as a T-intersection) and that vertex on line 'b' is not an end point. If the 'false positive' line is a bridge/overpass/underpass, all of the lines that intersect will also be deleted. For a dataset with ~185,000 line features @ step 2 above, the whole process (steps 2-10) took 14 minutes. The tool mentioned by Chris W, found here is only available @ 10.2.1 and above.
    – L Tyrone
    May 21, 2015 at 6:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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