I have a river network shape (or raster) and need to calculate the distance (river, not straight line!) for each pixel (or if not possible for lets say every 10 meters or for a random set of points) to the end of the river. I need this as a raster file. This will serve as an input for fish habitat modelling where the distance to source is an important predictor.

I know how to calculate that for a certain set of points via "locate features along routes", but how can I get it for "all" the points along the river?

I am using ArcGIS!

  • 3
    What software are you using? Jan 12, 2018 at 15:42
  • 2
    Your task sounds like it could be a "cost distance" or "cost surface" analysis.
    – cmrRose
    Jan 12, 2018 at 15:43
  • I am using ArcGIS! Ok, sounds promising. Any further ideas on how to approach that? I never used either of these 2. Thank you!!
    – Canna
    Jan 12, 2018 at 17:45
  • 1
    Standard hydrology toolset will do. Fill, flow direction, flow length. Extract values to points.
    – FelixIP
    Jan 13, 2018 at 0:26
  • @ FelixIP. Thanks for your suggestion. I am not working with a DEM though. But my river network is digitalized perfectly with all flow directions and river lenghts in place. So I am not sure how to use the hydrology toolset then.
    – Canna
    Jan 15, 2018 at 7:32

1 Answer 1


if you have a DEM and if the end of the river equals to the outlet, you've got a nice tool in r.stream.distance addon for grass; it calculates the distance and elevation difference from each point in your watershed to the outlet. It also calculates the distance to the stream for https://grass.osgeo.org/grass72/manuals/addons/r.stream.distance.html,

when you only want linear distance from all points in your region to a stream, then you should use r.grow.distance https://grass.osgeo.org/grass72/manuals/r.grow.distance.html enter image description here this image is the distance along a river (blue line) to its outlet, obtained with r.stream.distance, there's also module r.fidimo for fish distribution modelling, also raster.

  • I think the OP only wants distances within the stream network itself, not for each point in the watershed to the outlet.
    – Lovette
    Jan 12, 2018 at 16:40
  • Thanks for the replies. J.P.Lovette is correct, was talking about distances WITHIN the river network. Its for fish habtat modelling.
    – Canna
    Jan 12, 2018 at 17:43
  • you mean the distance of each point in the river to its outlet?
    – Elio Diaz
    Jan 12, 2018 at 18:12
  • i made an edit, just as a recommendation (i didn't see you are using arcgis)
    – Elio Diaz
    Jan 12, 2018 at 19:54
  • Thanks for your suggestion. I am not working with a DEM though. But my river network has all flow directions and river lenghts in place. Well, not outlet, but source. But that should just be "river length minus distance to outlet". So either would be fine!
    – Canna
    Jan 15, 2018 at 7:35

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.