AnsweredAssumed Answered

Raster Reclassify fails using ArcPy

Question asked by dklassen@kamloops.ca on Jul 9, 2019
Latest reply on Jul 9, 2019 by dklassen@kamloops.ca

I am trying to reclassify a raster to a single elevation band - and have the rest of the data as NODATA.  I am using the below code:

import arcpy
from arcpy import env
import os


overflowvalue = 894

resname = '2965'

minvalue = overflowvalue - 28
maxvalue = overflowvalue - 87


remapString = "{} {} 1".format(maxvalue, minvalue)
    
env.workspace = "D:\projects\Reservoir\\Data.gdb"
inRaster = 'Elevation'
outraster = 't_{}'.format(resname.replace(" ","_"))

arcpy.CheckOutExtension("3D")
print " - Reclassifying"

arcpy.Reclassify_3d(inRaster,field,remapString,outraster, "NODATA")

 

Eventually I want to put this in a loop to run it on 45 different overflowvalue elevations.  I am getting the following error when running as a stand-alone script:

D:\projects\Reservoir>test2.py
 - Reclassifying
Traceback (most recent call last):
  File "D:\projects\Reservoir\test2.py", line 24, in <module>
    arcpy.Reclassify_3d(inRaster,field,remapString,outraster, "NODATA")
  File "c:\Program Files (x86)\ArcGIS\Desktop10.5\ArcPy\arcpy\ddd.py", line 4467
, in Reclassify
    raise e
arcgisscripting.ExecuteError: ERROR 999999: Error executing function.
The table was not found. [VAT_t_2965]
No spatial reference exists.
Failed to execute (Reclassify).

 

Any help would be appreciated - using Python 2.7, ArcGIS 10.5.1
Thanks

Outcomes