4

I have run a hydrodynamic model which has given me a grid of surface elevations throughout a bay.

I am trying to process the results in ArcMap (or QGIS if needed). My goal is to take the current grid and buffer/expand (not sure of the correct terminology) the extent of the grid by 2 cells the whole way around, and have the new buffered cells inherit the value (water surface elevation value) from the neighboring cells from which they were expanded.

From what I have worked out so far there is an Expand tool in the Spatial Analyst toolbox, however, it only works on integer rasters, and I am dealing with a float raster.

I converted my grid to an esri raster grid (displayed in red below) and then used the expand tool to expand the raster by 2 cells (expanded area displayed in green below). I then used the raster calculator and a Con statement to recopy the float values back to the expanded raster. However, this does not copy any values over to the expanded cells.

So my question is, is there any way to somehow interpolate or use a nearest neighbor type tool to set the values of the expanded cells to the nearby cells from which they were expanded?

I have out together an example image to help me explain my problem: Example Image

Any ideas/help would be great!

Thanks,

5
  • you could extract the cells that neighbour (for speed) raster to point, point to TIN, TIN to raster and then Con on an isnull to fill the cells. Commented Apr 9, 2014 at 5:01
  • Hmmmm, that sounds like a great idea. Will try that shortly. Looks like i'm going to have to learn how to use the model builder to automate this whole process to redo it on a number of result files.
    – user27275
    Commented Apr 9, 2014 at 5:20
  • 1
    As the comment seems to fully address and solve the problem, it would be great if you could consider expanding it a little bit and post the solution as an answer (eventually accept it). Answers are searchable, editable, ratable, thus essential to maintain the very spirit of the GIS.SE community. Additionally it will also remove the question from the unanswered list.
    – lavarider
    Commented Apr 9, 2014 at 8:18
  • Better and faster: using Con with a condition based on the Euclidean distance to your data, patch a focal mean grid around the boundary. In fact, the focal mean grid alone (using a circular neighborhood of 2 cell radius) might be a good solution all by itself.
    – whuber
    Commented Apr 9, 2014 at 14:59
  • 1
    I like that approach as an implicit answer to the question, should you need more than 2 cells then increase the size of the neighbourhood. Unfortunately if there is a sudden rise on the landward side this will affect the result giving bumps in the sea as there is a possibility that the average is greater than the coast. Commented Apr 9, 2014 at 22:00

2 Answers 2

2

Define your area of interest with all the cells to be filled and a reasonable amount of neighboring cells, either raster or geometry and use extract by mask to smaller sample to reduce the processing time. Convert the extracted raster to point using raster to point (this will ignore the null cells).

From the derived points create either a TIN or Terrain which can then be rasterized using either TIN to Raster or Terrain to Raster. TIN is faster but has a point limit - anything near 1 million points and I would definitely go with the terrain! It would be good at this stage to use the original raster as a snap raster in the environment settings of the tool, this will ensure that the cells align; also specify the cell size from the original raster.

To insert the interpolated values back into the original perform IsNULL which will give a binary raster 1 where it is null and 0 where the raster has a value - use con with the condition raster as the isnull raster.

2

There is another simple alternative, assuming you are expanding into no data cells.

Raster menu > Analysis > fill nodata

Then set the distance in cells into which you wish to expand. It requires almost no processing power.

Hope that helps someone!

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.