Select to view content in your preferred language

is reclassify from the spatial analyst toolset available at the python command line?

1057
7
08-26-2011 06:25 AM
AmelieDavis
Emerging Contributor
Hi!
I'm trying to batch a bunch of files and have the following code:
arcpy.ReclassByASCIIFile_sa("D:/DATA/ILLINOIS/RFP_Landcover/Raster/chi_U19","C:/Users/Ams/Documents/SUM2011/recMap_chi_highres.txt","D:/DATA/ILLINOIS/RFP_Landcover/Raster/Reclass/Chi_U19_rc","DATA")
arcpy.ReclassByASCIIFile_sa("D:/DATA/ILLINOIS/RFP_Landcover/Raster/chi_U20","C:/Users/Ams/Documents/SUM2011/recMap_chi_highres.txt","D:/DATA/ILLINOIS/RFP_Landcover/Raster/Reclass/Chi_U20_rc","DATA")
...

I got the "code" from running it for one file and then using the "copy as python snippet" so it should work
but I get this error:
Runtime error <type 'exceptions.AttributeError'>: 'module' object has no attribute 'ReclassByASCIIFile_sa'

and when I try to get to the spatial analyst reclass tool in the command line by typing
arcpy.reclass only the ones from the 3D toolbox are available?

Does anyone know what I am doing wrong?  should I just use the 3D ones?

Any assistance is appreciated.
Amelie

PS Yes, I have checked that my spatial analyst toolbox is activated
Tags (2)
0 Kudos
7 Replies
AmelieDavis
Emerging Contributor
I just used the reclassify_3d and that worked - I don't know why reclassify_sa is not available but as long as they both do the same thing I guess it's OK.
Is there any major difference between the 2?
0 Kudos
ChrisSnyder
Honored Contributor
In arcpy there is a seperate sub-module for doing Spatial Analyst stuff... Try this:

arcpy.sa.ReclassByASCIIFile(blah, blah)

Other than different licensing requirements, I don't belive there is a differnce between these tools - I could be wrong though.
0 Kudos
AmelieDavis
Emerging Contributor
That worked!! Thanks a lot.  I do wonder still what the difference between the two is...

In arcpy there is a seperate sub-module for doing Spatial Analyst stuff... Try this:

arcpy.sa.ReclassByASCIIFile(blah, blah)

Other than different licensing requirements, I don't belive there is a differnce between these tools - I could be wrong though.
0 Kudos
JasonScheirer
Esri Alum
The sa toolbox in arcpy behaves slightly different than other tools to support the Raster object and map algebra natively.
0 Kudos
DanPatterson_Retired
MVP Emeritus
to find out about sa functionality, simply get its help
>>> from arcpy import sa
>>> help(sa.ReclassByTable)
0 Kudos
AmelieDavis
Emerging Contributor
Is there a difference between using reclass in spatial analyst versus 3d?

In arcpy there is a seperate sub-module for doing Spatial Analyst stuff... Try this:

arcpy.sa.ReclassByASCIIFile(blah, blah)

Other than different licensing requirements, I don't belive there is a differnce between these tools - I could be wrong though.
0 Kudos
ChrisSnyder
Honored Contributor
Sounds like in "backend" processing methodology: yes, in outcome: no.
0 Kudos