Created
March 27, 2017 20:56
-
-
Save GISmd/04b72f4adc91737d4a55606d3f69b634 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def addraster_list_to_mosaicdataset(rasterlist, mosaic_dataset_path): | |
"""Use this function to add a list of rasters to a mosaic dataset | |
Parameters: | |
rasterlist : list | |
List containing the paths to the rasters to be added to the mosaic | |
dataset | |
mosaic_dataset_path : str | |
String of the path to the mosaic dataset to which the rasters | |
will be added | |
""" | |
length = len(rasterlist) | |
for i, raster in enumerate(rasterlist): | |
print 'Processing raster {} of {}'.format(str(i+1), str(length)) | |
arcpy.AddRastersToMosaicDataset_management(mosaic_dataset_path, input_path=raster) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment