I wrote simple python code to do zonal statistics. My zonal input is a shapefile with a grid of equal-sized polygons. My input values are a raster of groundwater surface. Here is my code:
Here is what returned:
I've read several threads on similar errors, and the answers seems to be across the board and unrelated. Not sure how I should attack this. Help is appreciated. Thanks.
Grant
Code:
# Import arcpy module
import arcpy
# Check out any necessary licenses
arcpy.CheckOutExtension("spatial")
#import system modules
from arcpy import env
from arcpy.sa import *
#set environment workspace
env.workspace = "C://Users/gwest/Documents/Projects_Current/Kovacs"
#set output workspace
outWorkspace = "C://Users/gwest/Documents/Projects_Current/Kovacs/Zonal_Statistics"
#define variables
inZoneData = "farm_sa_privCopy.shp"
zoneField = "TARGET_FID"
inValueRaster = "ft_sat_nn"
# Process: Zonal Statistics
outZonalStatistics = ZonalStatistics (inZoneData, zoneField, inValueRaster, "MEAN", "DATA")
outZonalStatistics.save(outWorkspace + 'FT_SAT')
Here is what returned:
Code:
Getting data ..
Writing Output ...
Traceback (most recent call last):
File "C:\Users\gwest\Documents\Python Scripts\Zonal Stats Python Script.py", line 32, in <module>
outZonalStatistics.save(outWorkspace + 'FT_SAT')
RuntimeError: ERROR 010240: Could not save raster dataset to C:\Users\gwest\Documents\Projects_Current\Kovacs\ZonalSt_farm1 with output format GRID.
Grant