I have lines (rivers) that don't exactly match a raster grid (flow accumulation). If they were exact, I could just extract the raster values to points I put along those lines. However the raster values I want are often a few pixels away. Luckily the raster value I want are much larger than the surrounding pixel values. There used to be a tool that you could use to extract the maximum pixel value within a set distance from your point... but I can't remember the name of the tool.

  • 1
    What software are you using?
    – Aaron
    Jun 26, 2015 at 22:25

1 Answer 1


Compute the focal (neighborhood) maximum of the flow accumulation grid, using the smallest circular neighborhood you can get away with. Extract the values of that grid along the river features.

Given that flow accumulation grids are usually computed as sums of unit values, and therefore have integral values, you might also consider selecting the locally highest flow accumulations (using any number of methods) and computing their Euclidean allocation grids. Extract the Euclidean allocation along the river features. The result will differ slightly from the first one because this time you will have assigned the value from the nearest high flow accumulation cell to the river points, rather than the largest nearby flow accumulation.

Another approach, which might be more realistic and consistent, is to compute flow lines from the flow accumulation grid and use those in place of your existing river lines.

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.