# Import system modules import arcpy from arcpy import env from arcpy.sa import * # Set environment settings env.workspace = r"e:\test" # Set local variables inMaskData = "rmask.shp" outFolder = r"e:\test\masked" # Check out the ArcGIS Spatial Analyst extension license arcpy.CheckOutExtension("Spatial") # Get a list of the rasters in the workspace rasters = arcpy.ListRasters() # Loop through the list of rasters for inRaster in rasters: # Set the outputname for each output to be the same as the input outRaster = outFolder + "\\" + inRaster # Process: Extract by Mask arcpy.gp.ExtractByMask_sa(inRaster, inMaskData, outRaster)
Angemeldete Mitglieder können Beiträge verfassen, Updates folgen und mehr. Neu hier? Registriere ein kostenloses Konto.
Find useful guides, FAQs, and documents to help you navigate and make the most of Esri Community.