I'm looking for a way to check if cells from one raster file have contact or get close to cells from a second raster file. For example the blue raster is a barrier and the coloured is the flow accumulation and I want to know where it is possible for the flow accumulation to pass over in to the barrier raster which could be a river. Afterwards I want to define the watershed from this over passing points. I don't know how to find this points to compute with them, so I'm just looking for some suggestions how to start not a complete solution.

***Flowaccumulation (colored), Barrier(blue) ***

Using the con tool like Hornbydd suggested

enter image description here

Flowaccumulation raster


Extracted Flowaccumulation raster


Stream Network

Stream Network with "false pour Points"

1 Answer 1


It's not clear from your image if you want to extract all the cells along the edge, what you have numbered. Only 3 & 5 end at the blue barrier whilst 1, 2 and 4 run alongside and I presume flow off the edge at their downstream limit?

You do not state which GIS system you are using! So I shall assume ArcMap.

Here is one suggested work flow, there may be better ideas out there?

Here is a flow accumulation grid with a "barrier", all the cells of the barrier are 1:


Here is the flow accumulation thresholded to create a stream network

Stream network

  1. I run the barrier dataset through an IsNull tool that creates a new raster that is 1 where it was null and 0 where it had a value, as show below

IsNull grid

  1. Run the barrier raster through the Expand tool to expand by 1 pixel. In the image below the result of the Expanded grid is shown as pink with a slight transparency.

Expanded raster

  1. Multiply the result of IsNull by the result of the Expand raster, this creates a raster as such:

Edge raster

This creates an "edge" raster which is overlapping your flow accumulation raster by 1 pixel.

  1. Now using the CON tool you can extract out all the flow accumulation cells that overlap the edge cells (where they equal 1), creating this raster:

Intersecting edge cells with flow accumulation

  1. Finally using that stream network you first created use the CON tool again to pull out from the extracted flow accumulation cells that overlap the stream network. These are shown as red and green against the barrier and retain their flow accumulation values.

Final dataset

  • That works great. About your questions, you are right that only stream 3 and 5 end at the barrier and should be considered in this modelling. Yes I'm using Arc Map. I have a question to point 4 using the con tool. I'm running it as the picture above is showing though I'm not sure if the settings are right cause you get such a big range of variation in your output and I'm just getting a green frame even though my flowaccumulation wasn't. Am I doing something wrong? And could I run in the first con tool on the logarihmized flowaccumulation (stream network) to spare the second con tool?
    – Max2603
    Commented Apr 21, 2016 at 15:25
  • Without seeing the actual data it's hard to comment on you just getting a green frame. But looking at the amended question with CON tool screen shot that is how I ran it. Your flow accumulation looks odd to me because there is no graduated increase in colour and you seem to have no data between channels. Unless you have tweaked the symbology that is not a normal flow accumulation grid where every cell has a value. Not sure about second question as I use the second CON tool to extract out flow accumulation cells which are in the edge and stream network.
    – Hornbydd
    Commented Apr 21, 2016 at 19:23
  • My first picture shows a Flowaccumulation raster which is logarithmized and limited to log(flowaccumulations) >= 2, that is the reason for the missing cell values. I created this as a stream network raster but it seems it is not, is it?
    – Max2603
    Commented Apr 21, 2016 at 20:55
  • Your suggested solution works fine for Stream 3 and 5 but i cant figure out a way for handling Stream 1,2,4. Some Streams even touches the barrier but doesn't end at this point but rather flow on to some other pour point. Have you any Idea how to seperate this "false pour points"?
    – Max2603
    Commented May 11, 2016 at 12:14

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.