Select to view content in your preferred language

Clipping multiple rasters

5783
10
12-16-2009 01:48 AM
SabinePut
Emerging Contributor
Hi,

Would it be possible to clip multiple raster layers at once from the Image Analysis Window? Currently it is only possible to clip one raster layer at a time, which can be tedious if you want to clip several bands or datasets to the same view. To me this looks like a small enhancement, with great improvement to the user experience.

Kind regards,

Sabine Put
(ESRI Nederland)
0 Kudos
10 Replies
JieZhang
Esri Contributor
@jie, Hi!

How could you do that but iterating for several rasters (one above each other)

Thanks
Luc


Hi Lucc,

I assume you mean you want to use the same feature class to clip multiple rasters?

Here is a quick python example:

======================================
import arcgisscripting
gp = arcgisscripting.create()

gp.workspace = "c:/temp/inputras"

rasList = gp.ListRasters()

count = 0
name = rasList.next()
while name != None:
    outname = name.split(".")[0] + str(count) + ".tif"
    gp.Clip_management(name, "#", outname,"feature.shp", "0", "ClippingGeometry")
    count = count + 1
    name = rasList.next()

=====================================

There are many different ways to do it. You can also create a model or use the batch mode of the clip tool.

Jie
0 Kudos