Select to view content in your preferred language

Clipping multiple rasters

5782
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
RonaldBerger
Esri Contributor
Sabine,

Yes you can clip multiple images using the IAW window. In order to do this you first need to mosaic them. Select the images you want to use click the mosaic button in the processing panel. This creates a virtual mosaic function of your data. Then you can clip or export from that mosaic as you please.
Is this the functionality you are looking for?

Robert
0 Kudos
SabinePut
Emerging Contributor
Hi Robert,

Thanks for your quick reply! What I want is to have multiple images clipped to the same extent separately. Suppose I have a Landsat image with 8 bands as separate files, then I want my output clipped images to be 8 separate files as well.

I tried your suggestion, but creating a mosaic leaves me with only one image combined according to the operation (blend, mean, ...) that I choose. Or am I missing the point?

Sabine
0 Kudos
RonaldBerger
Esri Contributor
Hi Sabine,

Sorry I misunderstood your point. I thought you had several datasets adjacent to one another and you want your output clip to be a single dataset composed of the multiple datasets.
I think what you are looking for can be accomplished by batch-running the GP clip tool in Data Management > Raster > Raster Processing. Here you can specify the extent, input all your datasets, and then run the tool. To do this you go to the tool > right-click > batch.
I don't think there is an easy way (a batch way) to do this through the UI besides doing each dataset separately.
Does this help?

Robert
0 Kudos
SabinePut
Emerging Contributor
Hi Robert,

Yes, the functionality of the GP clip tool is indeed what I am looking for, but then made easier with the Image Analysis Window.
Is it possible to include this batch functionality in the Image Analysis Window? To me it does not seem like a big effort to include it, but I can be mistaken of course :-).
Otherwise just an idea for future releases.

Sabine
0 Kudos
EricRice
Esri Regular Contributor
Hi there,

If your bands/stacks of rasters are in the same workspace you might want to look into using a raster iterator in model builder in tandem with the Clip Raster tool.  I think it's even easier to use than batch mode. 

Regards,
0 Kudos
SabinePut
Emerging Contributor
Thanks Eric, this looks like a good alternative. I'll give it a try!
0 Kudos
MichelleGuck
Emerging Contributor
Hi all,

I am using 9.3.1 and new to this forum. I posted a new thread earlier then saw that you all may be able to help me with my paticular issue.

I am trying to batch clip rasters using python, the "clip" is by a shapefile and when loaded inside ArcGIS UI the rectangle extent automatically updates, this is not the case when in the python scripting environment. How can I set the rectangle extent parameters in python to update/change with a new shapefile? The rasters are adjacent to each other so a new raster is clipped for a new shapefile.

What I am trying to accomplish is clipping rasters without losing the cell beneath the polygon line. If that makes sense, I'm open to alternative methods/suggestions.

Thanks so much!

Michelle
0 Kudos
JieZhang
Esri Contributor
Hi Michelle,

In Python, you do not need to worry about the extent if you already have a clipping feature.

The Clip tool syntax looks like this:

Usage: Clip_management in_raster rectangle out_raster {in_template_dataset} {nodata_value} {NONE | ClippingGeometry}

e.g. gp.Clip_management("image.tif", "#", "clip.tif","feature.shp", "0", "ClippingGeometry")

You only need to give the path to your clipping feature for the "in_template_dataset" parameter. The tool will automatically pick up the extent of your clipping feature.

Jie
0 Kudos
LucianoCampagnolo
Emerging Contributor
@jie, Hi!

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

Thanks
Luc
0 Kudos