# Obtaining average value around polygon in raster for different cross sections?

I have elevation data in a raster, river (blue line) and the flooded area (black polygon) as shown in the image below:

I want to find the water depth in the flooded area (inside the black polygon). Outside of the polygon, water depth is obviously zero. Inside the polygon, the land elevation is lower than outside (At least it should be)

What I tried to do and did NOT work was this: I assigned nodata value to the points inside the polygon. Then I used Eucilidean Allocation to find the closest points just outside the polygon and assign it to nodata points. Then, I Subtracted the original land elevation raster from this new raster. However, I get big negative values because after all, it was not a good method at all.

Now, I am thinking: I need to follow the water stream line. At each point, draw a perpendicular line to the river and let it intersect minimum two times with the polygon. Find the average value of cells inside a circle (with those intersections as center). Find the mean of these averages. apply this value too all points in that cross section (perpendicular line to the river). Now, is there any way on earth I can do this? Hopefully I don't need a for loop for this? Do you guys have any other suggestions, perhaps easier ways?

I am using ArcGIS 10.1 with Spatial Analyst and 3D Analyst extensions.

• Just an observation, how did you get accurate points inside a watercourse? is it non-perennial? I regularly process LiDAR data and most sensors will not penetrate water. To give elevation inside a waterbody triangulation is applied but it's nowhere near accurate and takes the closest dry point and stretches it over the water area. Jul 1, 2014 at 21:49
• Does your polygon have z information? Your approach is correct - you need to create a surface raster out of the flood area elevation and then subtract the original from it to get the difference, or flood depth. What kind of 'big negative values' are you getting? I'm thinking your creation of the new flood surface raster might have had an issue. Jul 1, 2014 at 22:08
• Michael, You are absolutely right. The accuracy of the DEM inside of river channels are questionable. I am trying to do the best I can to get the flood depth from the extent polygon I have. Jul 1, 2014 at 22:13
• Chris! My polygon does not have z information. The negative values are due to very large size of grids (10x10 m). Jul 1, 2014 at 22:15
• @ChrisW, that's hydro-flattening. Trust me when I say it's not that easy. I put two months into developing, refining and testing a hydro-flattening program... and have the scars to prove it! For this simple model I think you should get the elevation onto the line, make a terrain from it then terrain to raster, extract by the original polygon and then difference that. If that makes sense let me know and I'll write it up as an answer with better descriptions. Jul 3, 2014 at 0:51

• I have a problem with building the terrain from the elevated waterbody. "Build terrain" function does not accept my elevated waterbody as input. Here's the code I use to make the elevated waterbody: `arcpy.InterpolateShape_3d(DEM, Flood_extent_shp, waterbody_elevated_shp, "", "1", "BILINEAR", "DENSIFY", "0")` Jul 3, 2014 at 15:25