1

I use a python script in which the function ZonalStatisticsAsTable is called. In ArcGIS9.3 it all worked fine. Our company just went to ArcGIS 10.1 and now it doesn't work anymore. When looking inside the resulting temporary tables it seemed the name of column number 2 was changed from "VALUE" to "NR". I changed it in the script and it all seemed to work fine. But, the results are very different from these in 9.3.

As input I use a rastermap with cellsize of 1x1km and a Polygon feature. I guess the polygon is converted to a raster first before the comparison is made. Whenever I first use "polygon to raster" to created a raster and use "Zonal Statistics as Table" with these two rasters as input the results are fine.
What goes wrong using then function ZonalStatisticsAsTable in the Pythonscript? Regards, Wilco.

2
  • 1
    Are the statistics the same between the two versions? For example, are you calculating "MEAN" in 9.3 and "MAJORITY" in 10.1?
    – Aaron
    Mar 29, 2013 at 14:25
  • Yes, the statistics are the same. I think I found why the results were different. This was because the file-format we are using was not implemented correct. A shift of 500m up and to the left. So I get exactly the same results now but I still do not understand why I get "NR" instead of "VALUE" in column number 2 in the outputtable form ZonalStatistics? Thanks for the help Mar 29, 2013 at 15:53

1 Answer 1

1

As input I use a rastermap with cellsize of 1x1km and a Polygon feature. I guess the polygon is converted to a raster first before the comparison is made.

When you do raster analysis in ArcGIS, it's a best practice (especially with 10.x) to make sure that the ArcGIS geoprocessing environments for extent, cell size, and snap raster are set to appropriate values.

My guess is you have not set the snap raster which is are not getting your cells to line up as needed to get the results you want. This would explain why when you use a raster zone instead of polygons you are getting what you want - the zone raster has the cells "snapped" to the same cell boundaries as your 1 km input.

Esri's help on Snap Raster has a nice graphic that explains this.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.