DennisJongsomjit

mosaic to new raster - how to mosaic rasters in different directories

Discussion created by DennisJongsomjit on Jun 11, 2014
Latest reply on Jun 12, 2014 by recurvata
Hi all,
Can anyone help with figuring out how to list multiple rasters that are each saved in different folders for using within the mosaic to new raster tool?  Can't figure this out after much searching and testing.  I've tried putting the input rasters in brackets, in quotes,without quotes... I just keep getting an invalid syntax warning Failed to execute (MosaicToNewRaster)..  The example in the help file only lists one raster as the input raster and so I nominate it for worst help file - why would you want to mosaic a single raster?!?

Thanks!

-DJ

----------
import arcgisscripting

gp = arcgisscripting.create(9.3)
workspace = r"Z:\Climate"
gp.workspace = workspace

outRaster = "mosaic12"
rastOne=r"V:\Project\rast1"
rastTwo=r"C:\Project\subfolder\rast2"
outRaster = "class7030"
gp.MosaicToNewRaster_management([rastOne;rastTwo], workspace, outRaster, "", "8_BIT_UNSIGNED", "2", "1", "FIRST", "FIRST")

-----------


If I use:
gp.MosaicToNewRaster_management("rastOne;rastTwo", workspace, outRaster, "", "8_BIT_UNSIGNED", "2", "1", "FIRST", "FIRST")

I get:
ERROR 000732: Input Rasters: Dataset rastOne;rastTwo does not exist or is not supported

Outcomes