Hawth's Analysis Tools for ArcGIS

SpatialEcology.Com

 You are here: Home > Hawths Tools > Tools Descriptions & Help

 Summary

CLIP RASTER BY POLYGONS TOOLS
Input: a polygon layer and one or more raster layers
Output: new raster layers, clipped to polygon boundaries
Features:

  • for each polygon in a polygon layer (or a selected subset of polygons) this tool clips one or more raster layers to the exact boundary of each polygon
  • the user may select multiple rasters from a list based on the raster layers that are loaded into ArcMap
  • the rasters are automatically named based on a unique ID number (integer) that must be present in the polygon layer
  • for each raster a new subfolder is created and the raster files are named using the convnention "r" + ID number (e.g. r149 for the polygon with the unique ID 149)
  • can be used with multi-band images

Limitations:

  • this tool does not support on-the-fly projection changes therefore the polygon layer and raster layers MUST SHARE THE SAME PROJECTION
  • this tool uses standard Spatial Analyst functionality and is therefore rather slow


[Click for larger view]

 Example

Figures A - D. In this example, a raster layer (A) is clipped to the boundaries of four polygons in a polygon layer (B). The result is four new rasters (GRID format) that are shown in C using red, yellow, green and blue colour coding just to illustrate that they are indeed four different rasters. As with all raster operations, a cell is only included in a clip if the centre of the cell falls within the boundary of the polygon, and this rule is illustrated in D which is a zoomed in look at a polygon boundary (black line) and the resulting raster clip.

 Help

Getting started. A polygon layer and at least one raster layer must be loaded into ArcMap in order to use this tool. The polygon layer must contain an attribute field (other than the FID) that represents a unique ID number (an integer) for each polygon. This field is used in the naming of the clipped rasters so that a raster clip can be easily tied back to the original polygon. THE POLYGON LAYER AND RASTER LAYERS MUST SHARE THE SAME PROJECTION. If they do not, you will have to reproject the layers so that they do share the same projection or you will get nonsensical results or no results at all.

Naming convention for new rasters. Within the output folder you specify a new folder is created that has the same name as each of the rasters that you elected to clip. Within each of these folders, a new raster layer is created with the following naming convention: r + unique_id, e.g. r149 corresponds to the raster clip for the polygon with the unique ID 149.

Why not all polygons result in a clip. If a polygon does not overlap the raster layer at all, it is simply ignored (partial overlaps are processed). If a clipped raster already exists with the unique ID that is currently being processed (i.e. if the unique ID's are not actually unique and duplicates occur) then the polygon is ignored.

Multiple bands. Raster layers in ArcMap display a maximum of 3 bands. A raster dataset on a disk can have more than 3 bands. This tool accesses the raster dataset on the disk to ensure that all the bands in the raster are retained in the new raster layer, not just the three bands that are loaded in ArcMap. The order of the bands is also retained in the new raster layer.

Why the new rasters may not look like the old raster. Raster band statistics are recalculated for the new clipped rasters. For all rasters and particularly for images (e.g. orthophotos) this can affect the way they look in ArcMap because these statistics are used to create a colour scheme for the new raster. The cell values of the rasters do not change - only the way they are displayed.

If you get an uninformative error message when trying to use the tool. This tool requires access to a Spatial Analyst license. The very first thing to check if you get an error message is that you have a license available (look under Extensions to ensure that the Spatial Analyst license box is checked).

Home | Articles | Services || Hawth's Tools:  Overview | Description | Download | FAQ