0

I am using arcpy and while running the script it is unable to find RasterCalculator() method? Even after imporiting arpy module

>>> RasterCalculator("IDSI_2002.img + IDSI_2007.img","D:/PythonScripts/test.img")
Runtime error 
Traceback (most recent call last):
  File "<string>", line 1, in <module>
NameError: name 'RasterCalculator' is not defined

Calculator' is not defined

0

1 Answer 1

2

In the Help for Raster Calculator it says:

Note:

The Raster Calculator tool is intended for use in the application only as a GP tool dialog box or in ModelBuilder. It is not intended for use in scripting and is not available in the ArcPy Spatial Analyst module.

3
  • but it is available it says that but arcpy.gp.RasterCalculator_sa is described right underneath
    – jtgis
    Commented Dec 15, 2017 at 22:18
  • @gomapping "the ArcPy Spatial Analyst module" is arcpy.sa not arcpy.gp.
    – PolyGeo
    Commented Dec 15, 2017 at 23:03
  • well if I create it in model builder and export as python the syntax is arcpy.gp.RasterCalculator_sa, however in my project i gave up on this and used raster math desktop.arcgis.com/en/arcmap/10.3/tools/3d-analyst-toolbox/…
    – jtgis
    Commented Dec 18, 2017 at 15:44

Not the answer you're looking for? Browse other questions tagged or ask your own question.