'============================================================== ' NAME: zonalst.ave ' DATE: Created 3/5/97 ' ' PURPOSE: Given a polygon Theme and a grid Theme, consider the ' polygons as zones and determine the average value of the ' grid cells in each zone. ' ' NOTE: This version is very simple and the names of the Themes ' and Fields of interest are hard-wired into the script. ' '============================================================== 'IDENTIFY INPUT DATA theProject=av.GetProject theView=theProject.FindDoc("View1") zoneTheme=theView.FindTheme("txrun2.shp") zoneFtab=zoneTheme.getFtab zoneField=zoneFtab.findfield("txclimt_id") valTheme=theView.FindTheme("bowall") valGrid=valTheme.GetGrid namest="bowavg.dbf" outFN=namest.asfilename 'MAKE ZONAL CALCULATION outVtab=valGrid.ZonalStatsTable(zoneFtab, Prj.MakeNull, zoneField, false, outFN) zoneTable=Table.Make(outVtab) zoneTable.SetName(namest) zoneTable.GetWin.Activate