Edit: the error was caused by spelling .tif
as .tiff`.
The script ran fine before I added InSR
, the input coordinate system.
I'm getting the following error:
arcgisscripting.ExecuteError: Failed to execute. Parameters are not valid.
ERROR 000445: Extension is invalid for the output raster format.
Failed to execute (ProjectRaster).
Here is my code:
import arcpy, sys, os
InFolder = r"E:\ReprojectionScript"
OutFolder = r"E:\ReprojectionScript\test"
OutSR = arcpy.SpatialReference(26918) # NAD83 / UTM zone 18N
InSR = arcpy.SpatialReference(26996) # Missouri East
arcpy.env.workspace = InFolder
rasterList = arcpy.ListRasters()
for Ras in rasterList :
inRaster = os.path.join(InFolder, Ras)
outFileName = "{}.{}".format(os.path.splitext(Ras)[0], "tif") # Remove .sid and add .tif to Ras filename
outRaster = os.path.join(OutFolder, outFileName) # Path and Filename of output raster (.tif)
arcpy.ProjectRaster_management (inRaster, outRaster, OutSR, "", "", "", "", InSR)
""
with"#"
""
with#
but it returned same error.