MBadar

Batch area calculation Zone-wise

Discussion created by MBadar on Dec 9, 2011
Hi,
I have daily landuse maps from which I've extracted vegetation in GeoTiff format of my study area. Each raster file (.tif) is saved with date as file name e.g. 21_12_1937.tif, 22_12_1937.tif and so on. Total Dataset exceeds 10,000 tif files. Attribute table of any particular day is like that

OID```Value```Count
0`````1```````2756

Here Value 1 represents the vegetation which is the only class in all rasters now.
This study area is divided into 10 administrative zones. I want to calculate vegetation area per defined zone. I can do this for a single date by applying "Zonal Statistics as Table" tool in spatial analyst and I get result like this

Rowid```Value```Count```Area```Min```Max```````.```````.```````.
0```````1``````124````12400```1``````1```````.```````.```````.
1```````2``````981````98100```1``````1```````.```````.```````.
.```````.```````.```````.```````.```````.```````.```````.```````.
.```````.```````.```````.```````.```````.```````.```````.```````.
.```````.```````.```````.```````.```````.```````.```````.```````.

Here Value in this table represents each zone from 1 to 10.

I can use batch processing in arcgis or arcobjects or python scripting to create such tables (INFO tables) for each date which are also saved on disk with dates as their file names. So far, so good.

Now I created a new blank INFO table (named as "OUTPUT"), populated the zones values such that table looks like this

Rowid```Value
0```````1
1```````2
2```````3
.```````.
.```````.
.```````.
9```````10

I then tried to batch join all tables to "OUTPUT" table and joined only Area Field.

Result was like this

Rowid```Value```AREA_1```.```````.```````.```````AREA_1_10```.```````.```````.
0```````1``````12400````.```````.```````.```````23400```````.```````.```````.
.```````.```````.`````````.```````.```````.```````.```````````.```````.```````.
.```````.```````.`````````.```````.```````.```````.```````````.```````.```````.

Here there are total 10 rows with "Value" ranging from 1 to 10 and though I batch joined all tables, the resultant table joined only 511 Area columns (I ran the process many times but each time no area column for 512th or more was joined) so from observation I came to know that columns in INFO table can't be greater than 512 in number. So, I had to break my batch join process into the chunks of 500 tables per run (For each run I got 1 separate output table). I then exported each output table into excel. Replaced AREA_1 .... series with corresponding dates and then joined and transposed each output table in excel. Also handling such huge number of columns in excel is a big issue for me. This is too much time taking and cumbersome. I now have to repeat this process for same number of files for different study area. I don't want to go through all this again. I tried to search forums and googled to get any help on automation of this process but to no avail. Can anybody guide me to the right direction?
Is there any better option in arcgis which I can use to calculate zonal area of some feature (Vegetation in my case) other than "Zonal Statistics as Table"? If no then how can I calculate area of each zone such that zones become field and corresponding areas for each day of each zone are calculated as records/rows?

I am using ArcGIS Desktop v9.3. Any help would be highly appreciated.

Outcomes