Unable to get Zonal Statistics by table with DEM

5518
5
05-23-2012 06:15 AM
mattparoulek
New Contributor
Hey all -

I am having some trouble getting the national map DEM (10m) data to a point where I can analyze the average slope of a number of wetland polygons (+/- 4500). 

My plan of attack was to mosaic two USGS NED 10 m DEM quad rasters to cover my area (a watershed), calculate slope with the slope tool, then run zonal statistics as table to get the average mean.  I can then select out those polygons with a certain average slope.

The raster has no attribute table (zonal stats needs this), so I built an attribute table.  But wait, you can't build an attribute table on a 32 bit floating integer, so I copied the raster in to a 64 bit (also tried 18, 16 etc), then built an attribute table.  Still not working, just an empty table.  I have converted the polygon layer to raster (not ideal as some of the polygons are smallish), and no success.

This is beginning to take some of the fun out of this project.  Any help will be appreciated!

Thanks!

Matt
0 Kudos
5 Replies
EricRice
Esri Regular Contributor
Matt,

There is no requirement that the input value raster has an attribute table.  It is only required of the zone raster.

Also, with regard to this comment: "I have converted the polygon layer to raster (not ideal as some of the polygons are smallish), and no success."  If you don't convert the polygon zones to raster, we do it anyway behind the scenes.  This is how the tool works.  Below are some key parts of the Usage Tips from the tool.


  • The input value raster can be either integer or floating point. However,  when it is floating-point type, the zonal calculations for majority,  median, minority, and variety will not be computed.

  • It is recommended to only use rasters as the zone input, as it offers  you greater control over the vector-to-raster conversion. This will help  ensure you consistently get the expected results.

  • If the zone input is a feature dataset with relatively small features,  keep in mind that the resolution of the information needs to be  appropriate relative to the resolution of the value raster. If the areas  of single features are similar to or smaller than the area of single  cells in the value raster, in the feature-to-raster conversion some of  these zones may not be represented.

  • If  the zone feature input has overlapping polygons, the zonal analysis  will not be performed for each individual polygon. Since the feature  input is converted to a raster, each location can only have one value. An alternative method is to process the zonal statistics iteratively for each of the polygon zones and collate the results.

Here is the full documentation for the tool.  Zonal Statistics as Table

Best Regards,
Eric
0 Kudos
mattparoulek
New Contributor
sorry, i guess I should have been more clear.  The attribute table was necessary to copy the raster to convert it from 32 bit float.  I am trying it with 16 bit, although I'm a little dissapointed to loose some of those data...
0 Kudos
mattparoulek
New Contributor
I think I have solved this problem (all i needed was an average slope measurement for polygons from a DEM) I guess it was a projection and pixel type problem:

Used the Slope tool on 10 m DEM. Copy raster tool to change pixel type to 16 bit (zonal stats can't deal with a 32 bit float?!).  Added attribute table (can skip this step...will happen automatically with zonal stats). Added a new field: �??id�?? to base z-stats by table tool on (can�??t use OBJECTID?!). Ran Zonal stats by table.
checked the results....

Not exactly sure what the 'count' is or what the 'area' is measuring.  Several polygons were not used for some reason (+/- 150 out of 4500) not sure why. Otherwise,  the numbers seem to make sense.

If anyone has any suggestions on why this is, I would be interested...at this point I can use what I've got and frankly I've spent much too long on this issue.

Good Times!!

M@
0 Kudos
JohnCobb1
New Contributor
Matt,

I was going to recommend the USGS's Hydro1K North America dataset, which has a slope raster derived from DEM data. The documentation may still be helpful, because it explains most of the processing steps. The data is at the 1 kilometer cell size, and may be too coarse for your needs. The count field contains the number of cells found within the polygons, if you have a counts in the 1-2 range this may explain why you are missing a few values. The reason you are missing stats for a few polygons is that those individual polygons may not contain a raster cell center. You could try using the resample tool to reduce the cell size.

- John
0 Kudos
EricRice
Esri Regular Contributor
Zonal Statistics as Table works with 32 bit floating point rasters.  There is no table requirement for the input value raster.  We could not enforce a table requirement even if we wanted to because of the fact that you can input 32 bit float rasters.  All you needed to do was use your polygons as the zone features, and the Slope result (in 32 bit form) as input value raster, as well as set some of the environment settings per the documentation.

As for the missing records, please review the last two bullet points in my previous post.  I'm pretty sure you are using polygons as the zone features, so you should also be setting the cell size to use for analysis within the environment settings.  This tip is included in the documentation I linked to earlier. The easiest way to guarantee results is to convert your polygons to a raster that has the same cell size as the DEM so the resolutions match.  This will also help you verify you have the correct number of zones in the raster - It should be the same as the number of polygons, assuming each polygon had a unique ID and a single polygon was not smaller than 10m squared, for your case.  If you continue to input polygons (which is completely ok) you should ensure that the results of the internal conversion will align properly with  the value raster, by checking that the extent and  snap raster are set appropriately in the environment settings and the  raster settings.  If you decide to convert ahead of time you also need to set the extent and snap raster to ensure alignment.

The use of ObjectID or other reserved fields is also discussed in the tool documentation I linked to earlier.

Best Regards,
Eric
0 Kudos