Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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). Surely this is possible without buying that expensive arcmap extention for QA/QC.

share|improve this question
    
If you select a single feature in the layer, and run the tool on that, does the resulting selection contain the features you expected? –  Arabella Oct 23 '12 at 5:23
    
I am not seeing the behavior you describe using the sample data I have. Could you upload a sample of your data that you can reproduce this behavior with? I would expect that all features would be selected. –  blah238 Oct 23 '12 at 8:32
    
add comment

2 Answers

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.

share|improve this answer
    
That makes sense that you have to select features before performing select by location within a layer. Thanks. –  user12189 Oct 23 '12 at 17:31
add comment

Here is a 2 step process that will select the Linear features that are connected. First run "Intersect" on the WaterLines, be sure to choose "Point" for the Output Type. This will create a Point at each shared Node or overlapping line. Finally, run "Select By Location" to select the Waterlines that intersect the Points. I had to use a "1 meter" search distance for selection to work.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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