I have a river dataset, which is dissolved, so between two lakes there will always be one single river line.

Now I want to find all rivers that starts in a lake, and ends in a lake. So if my rivers are stored as line features, and the lakes as polygon features, I need to find all lines whose both start point and end point touches a polygon in the lake data set.

How do I do that in either ArcGIS or QGIS (preferrably without any programming).

  • Do you consider a Spatial SQL Query as programming ? Feb 3, 2020 at 12:39
  • Find as in "select & extract", or find as in "add an attribute"?
    – Erik
    Feb 3, 2020 at 12:52

1 Answer 1


In ArcGIS use the Feature Vertices To Points tool to create two different datasets, an end vertices dataset and a start vertices dataset. Select all those start vertices that intersect lakes. Select all end vertices that intersect lakes. Select all line that intersect the selected start vertices. From those selected lines select all lines that intersect the selected end vertices. Now you should have a line selection that includes any lines connecting lakes, and all lines inside of lakes. Remove from the selection any lines contained within the lake polygons.

You mention your data is dissolved. Are the line segments between the lakes the same record as the line segments before or after a lake? If so, some geometry editing will be required. Maybe a screen shot of your rivers symbolized by ObjectID would be useful.

  • That will not solve the problem, because it the lines and the polygons do not overlap other places than at the end points of the lines. The select by location in ArcGIS selects any line where at least one of the end points touches the polygons. I require that both endpoints must touch a polygon. Feb 27, 2020 at 15:25
  • Sorry, I understood your question to mean you wanted to identify those river sections that started and ended inside of a lake. I have edited my answer above.
    – GBG
    Feb 27, 2020 at 16:02
  • I agree with GBG, @AgnarRenolen should edit your question and insert an image of your data.
    – Hornbydd
    Feb 27, 2020 at 16:57

Your Answer

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

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