[GIS] Selecting features based on relation to other features within same layer using ArcGIS Desktop

arcgis-desktopselect

I want to select all the features in my Waterlines layer that share a line segment with other features in the same layer. I've done a complicated search cursor iteration in python that takes a couple hours, but I'd rather have something quicker.

I found this page that says you can do it simply with "select by location" which doesn't seem to work from the selection menu in arcmap, but kind of works in arcpy.

http://help.arcgis.com/en/arcgisdesktop/10.0/help/index.html#/Select_By_Location_Select_based_on_spatial_relationship_within_the_layer/0017000000tr000000/

When I ran this:

arcpy.SelectLayerByLocation_management("waterlines_layer", "SHARE_A_LINE_SEGMENT_WITH", "", "", "NEW_SELECTION")

…it selected things that definitely didn't share a line segment with anything else. But it didn't select everything (which would have at least made some sense).

Best Answer

The reason Select by Location is not able to do this in one fell swoop is that it considers every feature in the layer against every other feature including itself. So iteration is necessary using this tool and considering one feature at a time.

As you mentioned there are geometry on geometry checks in Data Reviewer that can do this but I'm not sure how much faster if any it would be.

Related Question