Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- env.workspace = "My raster folder"
- rasterList = arcpy.ListRasters("*.img")
- print rasterList
- #works
- OutDir= "My output raster folder" + raster [0:7] + ".img"
- #Here is my loop that won't work
- for raster in rasterList:
- OutRaster = Con(IsNull(raster), 0, raster)
- outCon.save(OutDir)
- #this prodices only one raster out of the 50 rasters in the List.
- Con(IsNull(raster1), 0, raster1)
- Con(IsNull(raster2), 0, raster2)
- Con(IsNull(raster50), 0, raster50)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement