1

I'm trying to to complete a batch mosaic operation in ArcMap 10.4.1 Python window. I need to run the Mosaic tool about 80 times for sets of three rasters. Basically I want the second raster to mosaic to the first raster with all of the default mosaic properties. My code to do this is pasted below, but after trying to run the code I receive the following error.

How do I fix this problem?

Runtime error  Traceback (most recent call last):   File "<string>", line 39, in <module>   File "c:\program files
(x86)\arcgis\desktop10.4\arcpy\arcpy\management.py", line 13233, in Mosaic     raise e ExecuteError: 
ERROR 000840: The value is not a Raster Dataset.

Code:

# Name: Batch mosaic
... # Description: Batch mosaic processes
...  
... # Import system modules
... import arcpy
... from arcpy import env
... from arcpy.sa import *
... import math
...  
... # Set environment settings
... env.workspace = "C:\Users\dtma224\Desktop\PhD\Paper 2\Timing\Subbasin Connectivity Flow Time"
...  
... # Check the ArcGIS Spatial Analyst extension license
...  
... arcpy.CheckOutExtension("Spatial")
...  
... count = 1
...  
... # Run for each raster in the directory 
...  
... while count < 2:
...  
... # Execute times flow direction calculation
...       
...     name1 = "Day72Subbasin" + str(count) + " Bin 1.tif" 
...      
...     Bin1 = Raster(name1)
...     
...     name2 = "Day72Subbasin" + str(count) + " Bin 2.tif" 
...      
...     Bin2 = Raster(name2)
...     
...         
...     arcpy.Mosaic_management(Bin2, Bin1, "LAST", "FIRST", "", "","NONE", "0", "NONE")
...    
...     count = count + 1 
... 

Your Answer

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

Browse other questions tagged or ask your own question.