I built this code to multiply rasters but it will not execute, it gives me the following error: ERROR 000732: Input Raster: Dataset in_raster1 does not exist or is not supported

# Import arcpy module
import arcpy 
from arcpy import env
from arcpy.sa import *

arcpy.env.overwriteOutput = True
arcpy.env.workspace = outRas = "P:\del\New Folder\new" 

# Local variables:
in_raster1 = arcpy.GetParameterAsText(1)
in_raster2 = arcpy.GetParameterAsText(2)
in_raster2 = arcpy.GetParameterAsText(3)

# Process: Raster Calculator
outRas = Raster("in_raster1") * Raster("in_raster2")* Raster("in_raster3")

Any help?


You're inputting your variables as string. Try without the quotes.

outRas = Raster(in_raster1) * Raster(in_raster2) * Raster(in_raster3)

You need to save outRas:


pd: GetParameterAsText should start with 0, not 1 as you have.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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