Clip (Data Management) |
|
Release 9.3
Last modified March 8, 2012 |
![]() ![]() ![]() Print all topics in : "Tools" |
NOTE: This topic was updated for 9.3.1.
Creates a spatial subset of a raster dataset
Illustration
Usage tips
Command line and Scripting
The Clip tool allows you to extract a portion of a raster dataset based on a template extent. The clip output will include any pixels that intersect the template extent.
The clipped area is specified either by a rectangular envelope using minimum and maximum x- and y-coordinates or by using a output extent file. If the clip extent specified is not aligned with the input raster dataset, this tool will make sure that the proper alignment is used. This may cause the output to have a slightly different extent than specified in the tool.
An existing raster of vector layer can be used as the clip extent. If you are using a feature class as the output extent, you have the option to clip the raster by the minimum bounding rectangle of the feature class or by the polygon geometry of the features. If Clipping Geometry is used, then the pixel depth of the output may be promoted. Therefore, you need to make sure that the output format can support the proper pixel depth.
When using ArcMap, you also have the ability to use the selected features as the clipping extent. If a feature within the feature class is selected and Input Features for Clipping Geometry is checked, then the output will clip out the areas that was selected. If a feature within the feature class is selected but the Input Features for Clipping Geometry is not checked, then the output will clip out the minimum bounding rectangle for that feature.
You can save your output to BMP, GIF, GRID, IMG, JPEG, JPEG 2000, PNG, TIFF, or any geodatabase raster dataset.
When storing a raster dataset in a geodatabase, no file extension should be added to the name of the raster dataset. When storing the raster dataset in a file format, you need to specify the file extension: .bmp for BMP, .gif for GIF, .img for an ERDAS IMAGINE file, .jpg for JPEG, .jp2 for JPEG 2000, .png for PNG, .tif for TIFF, or no extension for GRID.
When storing your raster dataset to a geodatabase, you can specify a compression type and compression quality within the Raster Storage Settings in the Environment Settings.
If the clip extent specified is not aligned with the input raster dataset, the Clip tool will make sure that the proper alignment is used. This may cause the output to have a slightly different extent than specified in the tool.
If you are using a feature class as the Output Extent, you have the option to clip the raster by the extent of the feature class or by its polygon perimeter.
The extent values must be in the same spatial coordinates and units as the raster dataset.
The following environments affect this tool: current workspace, scratch workspace, output coordinate system, snap raster, output CONFIG keyword, pyramid, raster statistics, compression, and tile size.
Command line syntax
An overview of the Command Line window
Clip_management <in_raster> <rectangle> <out_raster> {in_template_dataset} {nodata_value} {NONE | ClippingGeometry}
Parameter | Explanation | Data Type |
<in_raster> |
The input raster dataset. |
Composite geodataset |
<rectangle> |
The four coordinates defining the minimum bounding rectangle to be clipped. Define in this order: X-Minimum, Y-Minimum, X-Maximum, Y-Maximum. If the clip extent specified is not aligned with the input raster dataset, the clip tool will make sure that the proper alignment is used. This may cause the output to have a slightly different extent than specified in the tool. |
Envelope |
<out_raster> |
The output raster dataset. Make sure that this output format is able to support the proper pixel depth. When storing the raster dataset in a file format, you need to specify the file extension: .bmp for BMP, .gif for GIF, .img for an ERDAS IMAGINE file, .jpg for JPEG, .jp2 for JPEG 2000, .png for PNG, .tif for TIFF, or no extension for GRID. When storing a raster dataset in a geodatabase, no file extension should be added to the name of the raster dataset. A raster dataset stored in a geodatabase can be compressed; you can specify a compression type and compression quality. |
Raster dataset |
{in_template_dataset} |
An existing raster or vector layer, which will be used as the clip extent. The clip output will include any pixels that intersect the minimum bounding rectangle. If a feature class is used as the output extent and you want to clip the raster based on the polygon features, choose the ClippingGeometry option. If Clipping Geometry is used, then the pixel depth of the output may be promoted. Therefore, you need to make sure that the output format can support the proper pixel depth. |
Geodataset |
{nodata_value} |
All the pixels with the specified value will be set to NoData in the output raster dataset. |
Integer |
{NONE | ClippingGeometry} |
If you are using a feature class as the Output Extent, you have the option to clip the raster by the extent of the feature class or by its polygon perimeter.
|
Boolean |
Clip_management C:\RasterData\test\clip_geo.tif '1945705 288915 1963287 299551' C:\RasterData\test\clip_test.img C:\RasterData\test\clip_geo.shp 255 ClippingGeometry
Scripting syntax
About getting started with writing geoprocessing scripts
Clip_management (in_raster, rectangle, out_raster, in_template_dataset, nodata_value, clipping_geometry)
Parameter | Explanation | Data Type |
in_raster (Required) |
The input raster dataset. |
Composite geodataset |
rectangle (Required) |
The four coordinates defining the minimum bounding rectangle to be clipped. Define in this order: X-Minimum, Y-Minimum, X-Maximum, Y-Maximum. If the clip extent specified is not aligned with the input raster dataset, the clip tool will make sure that the proper alignment is used. This may cause the output to have a slightly different extent than specified in the tool. |
Envelope |
out_raster (Required) |
The output raster dataset. Make sure that this output format is able to support the proper pixel depth. When storing the raster dataset in a file format, you need to specify the file extension: .bmp for BMP, .gif for GIF, .img for an ERDAS IMAGINE file, .jpg for JPEG, .jp2 for JPEG 2000, .png for PNG, .tif for TIFF, or no extension for GRID. When storing a raster dataset in a geodatabase, no file extension should be added to the name of the raster dataset. A raster dataset stored in a geodatabase can be compressed; you can specify a compression type and compression quality. |
Raster dataset |
in_template_dataset (Optional) |
An existing raster or vector layer, which will be used as the clip extent. The clip output will include any pixels that intersect the minimum bounding rectangle. If a feature class is used as the output extent and you want to clip the raster based on the polygon features, choose the ClippingGeometry option. If Clipping Geometry is used, then the pixel depth of the output may be promoted. Therefore, you need to make sure that the output format can support the proper pixel depth. |
Geodataset |
nodata_value (Optional) |
All the pixels with the specified value will be set to NoData in the output raster dataset. |
Integer |
clipping_geometry (Optional) |
If you are using a feature class as the Output Extent, you have the option to clip the raster by the extent of the feature class or by its polygon perimeter.
|
Boolean |
# Create the geoprocessing object import arcgisscripting gp = arcgisscripting.create() gp.workspace = r"C:\RasterData\test" gp.clip_management("clip_geo.tif","1945705 288915 1963287 299551","clip_test.img","clip_geo.shp","255","ClippingGeometry")
Map Algebra syntax
Not available
ArcObjects syntax
See Clip.