I'm not sure if the following task is possible in ArcGIS, or whether I need to use something like MatLab - I wondered whether the community could possibly advise if it is possible, and if so, what tools would be best to use.

I have a grid set up (see image below), with raster values (orange) to extract to a buffer zone [polygon] (light green) along the coastline [a polyline] (where the coastline acts as source inputs into the ocean). Not all of the grid cells in the buffer are on the coastline however, so I was wondering if there was a way to map their values to the nearest coastline grid cell.

I'm happy for any output of the raster into the grid. All I require at the end is that each grid cell on the coast has a co-ordinate (already defined) and a total population value (the raster) that is on the coastline AND that derived from other cells in the buffer being allocated to their nearest coastal cell.

There are datasets for the coastline, the buffer, and the raster.


Desktop Version 10.2 Co-ordinate system: WGS84

I am happy to provide the datasets if it would be of assistance.

  • What would be the values for inland cells (greens)? for the orange cells? Are there yellow cells too? My question is if you are able to tell -based on their values- if a cell is either inland, buffer or ocean. And why do you have mixed values cells (one cell -square- with both green and orange)?
    – Delonix R.
    Jun 15, 2016 at 12:38
  • Hi - sorry - that is confusion on the layering. The raster layer is the orange layer (on the bottom) representing the population. The resolution of this is defined as that of the grid. The darker the orange, the greater the population. Stacked on top of this, is the buffer (which is green), which is defined as a point 50km away from the shoreline. The ocean is only the blank cells.
    – GneissDay
    Jun 15, 2016 at 12:56
  • Assign unique IDs to the coastal cells, perform a Euclidean Allocation to extend them into corresponding ocean zones, then do a zonal summary.
    – whuber
    Jun 15, 2016 at 14:38

1 Answer 1


I don't know if that can be done interactively in Arc. You can use a python script to find the value of each of the 8 neighbor cells (for each cell in your population raster). If a cell has a value>0 and 1 or more cells with values greater than 0 but not all of them is a coastline cell. This code helped me, or at least show me how to do: https://gist.github.com/geoSpacer/10203189#file-calc_topex-py. It's not meant to solve this case, but the data flow it's quite similar. And the logic is as described above. Hope this help a bit.

  • Glad it helped. Do you mind mark it as best answer? (If better help comes along the way, you can always change your mind). Keep asking if you find troubles thru your code. Thanks.
    – Delonix R.
    Jun 15, 2016 at 14:45
  • Hi. How did it go?
    – Delonix R.
    Jun 16, 2016 at 16:15

Your Answer

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

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