Resample Fails in python script (error 999999)

356
2
Jump to solution
11-09-2023 08:54 AM
BrandWinlab
New Contributor

I am trying to write a python script to resample a batch of raster files. Just to check that I was getting the syntax/arguments for arcpy.Resample_management I tried to run it on a single file with the line shown below. 

arcpy.Resample_management("T613_36_5000_2010.tif", "test.tif", "20", "Bilinear")

However it fails with an Error 999999 ExecuteError. 

ExecuteError: ERROR 999999: Something unexpected caused the tool to fail. Contact Esri Technical Support (http://esriurl.com/support) to Report a Bug, and refer to the error help for potential solutions or workarounds.
Failed to create raster dataset
Failed to execute (Resample).

 What I noticed is that in the Geoprocessing window it showed the recent failures, clicking on there to bring up the tool in the GUI it brought up the same input settings I was trying to use in the python code and it worked fine (not sure if there is any fundamental differences in how the tools are executed between the GUI and a python notebook in ArcGIS).

Any help would be wonderful!

 

0 Kudos
1 Solution

Accepted Solutions
BrandWinlab
New Contributor

Thanks for the response Dan. I had actually been using the full path before (just shorted it for ease of posting here, along with missing some of the earlier code like "import arcpy"), but you set me on the track to fix it. Rather than using the full path I tried explicitly set the environment workspace to the working folder and used relative paths, and it works!

View solution in original post

0 Kudos
2 Replies
DanPatterson
MVP Esteemed Contributor

try specifying full paths to the input and desired output.

The geoprocessing window knows the "workspace" environment and it isn't specified in your example


... sort of retired...
BrandWinlab
New Contributor

Thanks for the response Dan. I had actually been using the full path before (just shorted it for ease of posting here, along with missing some of the earlier code like "import arcpy"), but you set me on the track to fix it. Rather than using the full path I tried explicitly set the environment workspace to the working folder and used relative paths, and it works!

0 Kudos