polygon cell statistics

453
7
Jump to solution
06-06-2012 04:04 AM
ElaineKuo
Occasional Contributor
System: ArcGIS 9.3
Dataset:
1. polygons of 3000 grid cells, each containing the average annual temperature of the grid cell
2. tree distribution map for 5 species (polygons) (species 1 to 5)

Purpose
I want to know the average annual temperature of the ranges of species 1 to 5.
Also, I want to compare if there is any difference in average annual temperature between the species distribution.

Procedure:
Step 1:
Clip the grid cell polygons using the distribution maps of the five tree species respectively.

Step 2: calculate the average of the annual temperature of the clipped polygons from species 1 to 5

Problem:
Please kindly advise which method in ArcGIS 9.3 can perform step 2 for polygons.
Also, please kindly advise if it is possible to be written in python for automation for more than 100 tree species.
Thank you in advance.

(Once zonal statistics was suggested.
However, it was based on raster.
I tried it but found this was time and space-consuming
to transfer polygons to raster based on fine-scale.)
Tags (2)
0 Kudos
1 Solution

Accepted Solutions
MarcinGasior
Occasional Contributor III
Default cell size populated by those tools may not be accurate at all.
The best you can do is to get to know the cell size of original temperature raster.
If it's not possible, zoom to square feature in your polygon layer and measure the length of a side.
Then provide this value as cell size in tool window.

View solution in original post

0 Kudos
7 Replies
MarcinGasior
Occasional Contributor III
Have you tried Zonal Statistics as Table?
You can provide species layer as 'Input raster or feature zone data', species name (or id) as 'Zone field' and temperature raster as 'Input value raster'.

You get a table with various statistics which can be joined back to the species layer by species identificator.

To loop through 100 species just iterate through them using ListFeatureClasses (your recent postings proove you can do that;))
0 Kudos
ElaineKuo
Occasional Contributor
Thanks for the immediate response.

However, I found zonal statistics has provided ArcObject code instead of python one for example.
Please kindly clarify if "the loop" means python or ArcObject.
If it is the latter, is it possible to make ArcObject loops using python?
(I am more unfamiliar with ArcObject than with python)
0 Kudos
MarcinGasior
Occasional Contributor III
In web help on Zonal Statistics as Table the Python scripting example is also present.
0 Kudos
ElaineKuo
Occasional Contributor
One of the input fields of zonal statistics as table confused me.
It was �??in_value_raster�?�.
I do not know which raster file to be input,
because I only have feature datasets at hand.
0 Kudos
MarcinGasior
Occasional Contributor III
I was convinced that the average annual temperature information layer is in raster format (as it's the best format to represent such data).

If you don't have an access to original raster data of teperatures, you can convert polygon layer back to raster.
Use Polygon to Raster tool (Conversion -> To Raster -> Polygon to Raster). It's important to know or measure the cell size in your polygon dataset.
0 Kudos
ElaineKuo
Occasional Contributor
Thanks for advising on polygon-raster conversion.
However, the output cell sizes were different when using �??feature to raster�?� and �??polygon to raster.�?�
Which output cell size is more close to the original cell size? Why?
0 Kudos
MarcinGasior
Occasional Contributor III
Default cell size populated by those tools may not be accurate at all.
The best you can do is to get to know the cell size of original temperature raster.
If it's not possible, zoom to square feature in your polygon layer and measure the length of a side.
Then provide this value as cell size in tool window.
0 Kudos