I am trying to loop through multiple rasters and extract cells that are above 0.1 The code I am trying to use is:
import arcpy arcpy.CheckOutExtension('Spatial')arcpy.env.workspace=r'F:\Sheyenne\Atmospherically Corrected Landsat\Indices\Main\NDWI\main_master'#pathway to all rasters in workspace directoryrasters = arcpy.ListRasters('*.tif*')for raster in rasters: #give new file a name outraster = raster.replace('.tif','_water.tif') arcpy.gp.RasterCalculator_sa("""raster >= 0.1""",outraster)print('Done Processing')but this returns a really long error that doesn't mean much to me.
أكثر...
import arcpy arcpy.CheckOutExtension('Spatial')arcpy.env.workspace=r'F:\Sheyenne\Atmospherically Corrected Landsat\Indices\Main\NDWI\main_master'#pathway to all rasters in workspace directoryrasters = arcpy.ListRasters('*.tif*')for raster in rasters: #give new file a name outraster = raster.replace('.tif','_water.tif') arcpy.gp.RasterCalculator_sa("""raster >= 0.1""",outraster)print('Done Processing')but this returns a really long error that doesn't mean much to me.
أكثر...