Friday, January 23, 2015

New tool - Multiple Raster Zonal Statistics

I just released a new tool called Multiple Raster Zonal Statistics for ArcGIS 10.1. This handy little tool can pull attributes such as cell counts from a whole directory of classified rasters potentially saving a lot of time.  I've also posted a link to it from our lab's download page.

Here is an example of how I've been using the tool.

I'm in the process of classifiying NAIP imagery which will be used to generate training and validation for a Landsat model of tree cover.  I've got 1348 random polygons scattered across 19 different NAIP tiles. In the left figure the purple polygons represent NAIP tiles and the tiny red dots are random points. Finding the cell count would involve 4 classes x 19 tiles = 76 runs of the Zonal Statistics tool in ArcGIS.
The Multiple Raster Zonal Statistics tool automates the process using two loops.  First it loops through the NAIP tiles and then it loops through each class in the categorical raster. The resulting output has same number of polygons as the original input, but is attributed with cell counts from each categorical class. You can see on the map in the figure on the right that the polygons are colored according to percent tree cover.

Some caveats: You may need to edit the code slightly if you wish to process more than 4 categories. There are instructions on how to do so in the python script itself. Before running the tool you will also need an index shapefile attributed with the name of each raster image. I did this using the create bounding box for geodatasets tool in the Marine Geospatial Ecology Tools.

No comments:

Post a Comment