¿Cómo puedo crear los parámetros pixel_type
y number_of bands
(como se encuentra en MosaicToNewRaster) como entradas de usuario al inicio de mi propio script?
ERROR 000714: Error en el script BatchMosaic. Error al ejecutar: cmd.exe /C C:\Erosion\Scripts\BATCHM ~1.PY " C:\finalproject\Mosaic " " C:\finalproject\Mosiac_out " "mosaicme" "32_BIT_SIGNED" "1" Fallo en la ejecución (BatchMosaic).
import arcpy, os, sys
#User parameters.
in_workspace = sys.argv[1]
out_workspace = sys.argv[2]
output_name = sys.argv[3]
def getParameterInfo(self):
param4 = arcpy.Parameter(
pixel_type="Input value")
param4.filter.type = "ValueList"
param4.filter.list = [""]
def getParameterInfo(self):
param5 = arcpy.Parameter(
number_of_bands="Input value")
param5.filter.type = "ValueList"
param5.filter.list = []
#Attempts to mosaic all raster files in root and sub directories.
rasters = []
for dirpath, dirnames, filenames in arcpy.da.Walk(in_workspace, topdown = True, datatype="RasterDataset", type = "TIF"):
for filename in filenames:
rasters.append(os.path.join(dirpath, filename))
#Pixel Type and Number of Bands must be manualy inserted to script.
arcpy.MosaicToNewRaster_management(';'.join(rasters), out_workspace, output_name, pixel_type = "32_BIT_UNSIGNED", number_of_bands = 1)