Select to view content in your preferred language

Purpose of "#" value in arcpy.AddRastersToMosaicDataset

635
2
Jump to solution
08-30-2022 04:35 AM
LanceCole
MVP Regular Contributor

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")

 

0 Kudos
1 Solution

Accepted Solutions
by Anonymous User
Not applicable

"#" is generally seen when exporting geoprocessing history/ models to python and says no parameter was set.  It's performs the same as '' or None.

View solution in original post

2 Replies
by Anonymous User
Not applicable

"#" is generally seen when exporting geoprocessing history/ models to python and says no parameter was set.  It's performs the same as '' or None.

DanPatterson
MVP Esteemed Contributor

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"
)

 


... sort of retired...