[GIS] How to select all streams downstream of a polygon

arcgis-desktophydrologypythonselect-by-attributeselect-by-location

I have an ordered stream network and I want to select all stream features that contain water that has come from a certain area. To start with I'm running a select by location query to find all stream segments that cross my polygon. The problem is that this does not select the stream segments further down stream that these segments flow into.

What I need to do is create a selection that will select stream segments that touch existing selected segments only if they have a higher number for the stream order attribute, then repeat this until the result does not change. I expect I have to do this in python, but I'm not sure of a few things: how to use the select by location and select by attribute at the same time (select intersecting lines that have a value above a threshold), how to make the threshold relate to the line you're checking the intersection with (select intersecting lines that have a higher value than the line they're intersecting with, how to get this to iterate through until the selection isn't changing.

This feel quite complicated, but I'm sure people will have run into this problem before so there might even be an easier way, or a tool. Is there?

This image is a manual section that shows what I'm trying to achieve – I want to select the streams that start in the green area and everything they flow into.enter image description here

Best Answer

If your polylines are consistently digitized (or otherwise created in your case) in one direction (downstream or upstream). You can use the Feature Vertices to Points tool to create a point layer representing start points or end points. So what you do with this is ...

  1. Intersect the polylines with the polygons (can use this to identify some feature of the polygon or ignore this extra bit of information).
  2. Create start points and then create end points (I believe you may want separate layers to make it easier to do the selections).
  3. Select [By Location] end points that intersect polygons.
  4. Use selected end points to select polylines (again by location).

If your polygons and polylines don't intersect multiple times, then this may get you where you need to be, but if not you can continue selections (we did this with a loop in python) using a series of "Select By Location" operations going from Start Points to End Points. This allowed us to go down from the polygons but never include anything inside or upstream. Give this a try. If I skipped a step, let me know where you run into problems and I'll look more closely at the script and revise as necessary.

Related Question