I have a problem using Zonal statistics in python using ArcMap 10.4. This is a completely random error, and I have no idea what to do. Some back ground is that I have been running a script doing batch processing work with zonal stats and extracting values etc. and it worked fine for various areas. All of a sudden the zonal statistics stopped working. There is no error, the program just ends abruptly.
I have tried to debug it in many ways (different environmental settings etc.) but here is the core of my problem:
A simple version of the program is as follow:
import os import arcpy from arcpy import env from arcpy.sa import * arcpy.CheckOutExtension("Spatial") from decimal import Decimal location = "C:/Users/Me/" shapefile = "C:/Users/Me/My_shapefile.shp" raster = "//server_location/raster_location/raster_file.tif" print "Start Zonal" outZonalStatistics = ZonalStatistics(shapefile, "Valid_ID", raster, "MEAN", "DATA") print "Done" print "Saving" outZonalStatistics.save(location + "mean_zonal") print "Done"
Then the output is as follow:
>>> Start Zonal >>> ================================ RESTART ================================= >>>
Thus the program just abruptly ends when Zonal Stats is being called.