Clip (Data Management) |
|
Release 9.2
Last modified November 29, 2010 |
![]() ![]() ![]() Print all topics in : "Tools" |
Creates a spatial subset of a raster dataset. The clipped area is specified by a rectangular envelope using minimum and maximum x and y coordinates.
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.
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 dialog box.
Your rectangular extent can be based on minimum and maximum x and y coordinates, or it can be based on the extent of a layer.
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, output CONFIG keyword, pyramid, raster statistics, compression, and tile size.
ArcObjects
The Clip object allows you to extract a portion of a raster dataset based on a rectangular extent.
The envelope defines the clip extent for your output raster dataset. The envelope values represent the lower-left coordinate's x value and y value, then the upper-right coordinate's x value and y value.
The extent values must be in the same spatial coordinates and units as the raster dataset.
The output raster will have the same cell size as the input raster.
Command line syntax
An overview of the Command Line window
Clip_management <in_raster> <rectangle> <out_raster> {in_template_dataset}
Parameter | Explanation | Data Type |
<in_raster> |
The input raster dataset. |
Composite Geodataset |
<rectangle> |
The four coordinates defining the area to be clipped. Define in this order: X-Minimum, Y-Minimum, X-Maximum, Y-Maximum. |
Envelope |
<out_raster> |
The output 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 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 layer of which the extent will be used as the clip extent. |
Geodataset |
Clip_management D:\images\OverviewImage\Layer_1 '549790 5272863 549870 5273000' D:\images\ClippedOverview1 #
Scripting syntax
About getting started with writing geoprocessing scripts
Clip_management (in_raster, rectangle, out_raster, in_template_dataset)
Parameter | Explanation | Data Type |
in_raster (Required) |
The input raster dataset. |
Composite Geodataset |
rectangle (Required) |
The four coordinates defining the area to be clipped. Define in this order: X-Minimum, Y-Minimum, X-Maximum, Y-Maximum. |
Envelope |
out_raster (Required) |
The output 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 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 layer of which the extent will be used as the clip extent. |
Geodataset |
# Create the geoprocessing object import arcgisscripting gp = arcgisscripting.create() gp.workspace = "c:/seattle_data" gp.Clip_management("seattle1.tif", "549790.051000 5272863.993000 549870.051000 5273000.993000","seattle_clip.img", #)
Map Algebra syntax
Not available
ArcObjects syntax
ITransformationOp::Clip(GeoDataset As IGeoDataset, Rectangle As IEnvelope) As IGeoDataset
Parameter | Explanation |
GeoDataset | An input Raster, RasterDataset, RasterBand, or RasterDescriptor. |
Rectangle | An IEnvelope identifying the lower-left and upper-right coordinates of the rectangle defining the area to be subset from the input GeoDataset. |
' Clips a portion of a raster dataset based on an extent. ' ' Function Clip(ByVal GeoDataset As esriGeoDatabase.IGeoDataset, _ ' ByVal Rectangle As esriGeometry.IEnvelope) _ ' As esriGeoDatabase.IGeoDataset ' ' Member of esriGeoAnalyst.ITransformationOp ' Create the RasterTransformationOp object Dim pTransformationOp As ITransformationOp Set pTransformationOp = New RasterTransformationOp ' Get raster Dim pRas01 As IRaster Set pRas01 = getRasterFromDiskFunction("c:\data\myRaster") ' Declare an envelope object Dim pEnvelope As IEnvelope ' Create an envelope Set pEnvelope = New Envelope pEnvelope.PutCoords 1, 1, 3, 3 ' Declare the output raster object Dim pGeoDS As IGeoDataset ' Calls the method Set pGeoDS = pTransformationOp.Clip(pRas01, pEnvelope)