I have a raster that represents water depth which was generated by subtracting a flood elevation raster minus a DEM raster along a river system. I have cases where there are negative depth values (i.e. DEM is higher than flood elevation), but are completely surrounded by positive depths - thus "islands" in the raster. I would like to "remove" these islands by replace the isolated negative depth cells with a constant depth of zero (or other specified constant).
The challenge that I am have is that I want to keep negative depth values that are not surrounded by positive depth values. I have many negative depth values along the edge of the raster (i.e. higher ground in the river valley) that I will ultimately replace with no data
Ive seen posts that suggest focal statistics, but I the problem I have with that is that I only want to change negative depth cells that are completely surrounded and I want to specify a constant value for them (rather than a mean or maximum)
Any suggestions would be greatly appreciated
Solved! Go to Solution.
Thank you Dan, Mody, and Xander for your quick response are helpful suggestions - the RegionGroup tool coupled with a few other processes did the trick.
A summary of the solution was:
Neal, the first thought that comes to mind is to use RegionGroup to identify the discrete zones that you have and perhaps incorporate that with a search by a threshold area or negative value, then replace those zones with your constant value ...
Region Group—Help | ArcGIS for Desktop
Creating individual zones with Region Group—Help | ArcGIS for Desktop
at least it will get you thinking how to identify the areas simply
Why not creating a constant raster with the same extent (there is a GP tool for that) and use the "con" command to replace some values in raster 1 with raster2?
Mody, that would also change the near shore values as well since they are negative an Neal wants to retain those for now. From the visual that is provided, the only criteria separating the surrounded negative values from the non-surrounded negative non-shore values is that they are discrete zones of a smaller size, hence, I think separating into zone (aka regions) then filtering by size criteria might work... unless there are other non-conformal zones skulking off-screen
The RegionGroup tool will identify the polygons, but if there are many small polygons it might be quite some work to identify those. You could also go for a vector approach. Convert a raster that contains two values to identify the grey and blue areas to polygons and identify those that are islands. Convert to raster and with the Con statement assign the values you want.
Thank you Dan, Mody, and Xander for your quick response are helpful suggestions - the RegionGroup tool coupled with a few other processes did the trick.
A summary of the solution was: