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:
- Make a copy of the roads dataset -> roads_copy
- Use "unsplit line" tool on roads_copy -> roads_unsplit
- Use "feature vertices to points" tool on roads_unsplit (point type: both ends) -> roads_vert
- Use "collect events with rendering" tool on roads_vert (quite time intensive) -> roads_collect (unattached ends get ICOUNT = 1)
- Query roads_collect: "Select from roads_collect where ICOUNT = 1"
- Export query result -> roads_icount1
- 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)
- Query roads_join: "Select from roads_join where Join_Count = 2"
- Use "select layer by location" on original (not unsplitted!) roads; selecting features = roads_join, relationship = "share_a_line_segment_with", selection type = "new_selection"
- 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.