AnsweredAssumed Answered

Using Multivalue to add multiple raster layers

Question asked by skasprick on Jan 25, 2016
Latest reply on Jan 26, 2016 by skasprick

I am trying to bring in multiple raster layers by using the multivalue parameter properties, however the script fails and states the dataset does not exist or is not supported.  I have attached the error message as well as the script I am using.  The raster layers are normally brought in directly from the TOC.

 

Error

Messages

Executing: CalcCompRasters Image1;Image2;Image3;Image4 S:\AVWorks\Scratch.gdb\avgtest

Start Time: Mon Jan 25 11:13:38 2016

Running script CalcCompRasters...

Failed script CalcCompRasters...

 

Traceback (most recent call last):

  File "S:\Data\My Toolboxes\MyScripts\Calculate Composite Rasters.py", line 24, in <module>

    OutAvgTemp = CellStatistics(InRasters, "MEAN", "DATA")

  File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\sa\Functions.py", line 2967, in CellStatistics

    ignore_nodata)

  File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\sa\Utils.py", line 53, in swapper

    result = wrapper(*args, **kwargs)

  File "c:\program files (x86)\arcgis\desktop10.3\arcpy\arcpy\sa\Functions.py", line 2963, in Wrapper

    [function] + Utils.flattenLists(in_rasters_or_constants))

RuntimeError: ERROR 000732: Input Raster: Dataset Image1;Image2;Image3;Image4 does not exist or is not supported

 

 

Failed to execute (CalcCompRasters).

Failed at Mon Jan 25 11:13:40 2016 (Elapsed Time: 1.97 seconds)

 

 

Below is the Script I am using.  This will be the start of a larger script, but until I get past this I won't add more to it.

 

# Import arcpy module

import arcpy

from arcpy.sa import *

 

# Script arguments

InRasters = arcpy.GetParameterAsText(0)

OutAvg = arcpy.GetParameterAsText(1)

 

# Process: Cell Statistics - Avg

OutAvgTemp = CellStatistics(InRasters, "MEAN", "DATA")

OutAvgTemp.save(OutAvg)

Outcomes