0

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.CheckOutExtension("3D")
arcpy.CheckOutExtension("spatial")
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?

PolyGeo
65.5k29 gold badges115 silver badges349 bronze badges
asked Jul 5, 2016 at 19:25

2 Answers 2

3

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

outRas = Raster(in_raster1) * Raster(in_raster2) * Raster(in_raster3)
answered Jul 5, 2016 at 19:41
1

You need to save outRas:

 outRas.save("Multiplication_Raster")

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

answered Jul 5, 2016 at 19:38

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.