Friday, 10 April 2015

Calculating raster layer statistics using ArcPy gives ERROR 000840?


I'm trying to write a script that will, in part, calculate statistics for a raster layer in an Arcmap mxd, but when I run the script I get an "invalid parameter" error (Error 000840), saying that the value isn't a Mosaic Layer, Mosaic Catalog, or Raster Catalog. The Calculate Statistics tool in the toolbox works fine for a single raster, so I'm not sure how to fix this. Relevant code block:


import arcpy
inRaster = arcpy.GetParameterAsText(0)
arcpy.CalculateStatistics_management(inRaster, "1", "1", "-9999")


Any suggestions?




No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...