I am updating some raster data and related processing scripts. In the code reference guide Add Rasters To Mosaic Dataset (Data Management) a value of "#" is utilized for some parameters. What is the intent of this value vs ""? Does it indicate to use the default value for the parameter?
import arcpy
arcpy.management.AddRastersToMosaicDataset(
"c:/data/AddMD.gdb/md_landsat", "Landsat 7 ETM+",
"c:/data/landsat7etm", "UPDATE_CELL_SIZES", "UPDATE_BOUNDARY",
"UPDATE_OVERVIEWS", "2", "#", "#", "GCS_WGS_1984.prj",
"*.tif", "SUBFOLDERS", "EXCLUDE_DUPLICATES",
"NO_PYRAMIDS", "NO_STATISTICS", "BUILD_THUMBNAILS",
"Add Landsat L1G", "FORCE_SPATIAL_REFERENCE",
"NO_STATISTICS", "", "USE_PIXEL_CACHE",
r"C:\test\cachelocation")
Solved! Go to Solution.
"#" is generally seen when exporting geoprocessing history/ models to python and says no parameter was set. It's performs the same as '' or None.
"#" is generally seen when exporting geoprocessing history/ models to python and says no parameter was set. It's performs the same as '' or None.
The alternative is to use "named" parameters rather than "positional"
Obviously more useful if you only want to specify a couple of optional parameters and you are using defaults between them.
import arcpy
arcpy.management.AddRastersToMosaicDataset(
in_mosaic_dataset="c:/data/AddMD.gdb/md_landsat",
raster_type="Landsat 7 ETM+",
input_path="c:/data/landsat7etm",
maximum_pyramid_levels="2",
spatial_reference="GCS_WGS_1984.prj",
filter="*.tif",
duplicate_items_action="EXCLUDE_DUPLICATES",
operation_description="Add Landsat L1G",
force_spatial_reference="FORCE_SPATIAL_REFERENCE",
"NO_STATISTICS", "",
enable_pixel_cache="USE_PIXEL_CACHE",
cache_location=r"C:\test\cachelocation"
)