ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Clip

  • Summary
  • Illustration
  • Usage
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

Cuts out a portion of a raster dataset, mosaic dataset, or image service layer.

Illustration

Clip illustration

Usage

  • This tool allows you to extract a portion of a raster dataset based on a template extent. The clip output includes any pixels that intersect the template extent. If you want to extract a portion of a feature dataset, use the Clip tool found in the Analysis toolbox.

  • The clipped area is specified either by a rectangular envelope using minimum and maximum x- and y-coordinates or by using an output extent file. If the clip extent specified is not aligned with the input raster dataset, this tool makes 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 or 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.

  • You also have the ability to use the selected features within the display as the clipping extent. If a feature within the feature class is selected and Use Input Features for Clipping Geometry is checked (clipping_geometry is set to ClippingGeometry), then the output clips out the areas that are selected. If a feature within the feature class is selected but Use Input Features for Clipping Geometry is not checked (set to NONE in Python), then the output clips out the minimum bounding rectangle for that feature.

  • You can save your output to BIL, BIP, BMP, BSQ, DAT, Esri Grid, GIF, IMG, JPEG, JPEG 2000, PNG, TIFF, or any geodatabase raster dataset.

  • The extent values must be in the same spatial coordinates and units as the raster dataset.

Syntax

Clip_management (in_raster, rectangle, out_raster, {in_template_dataset}, {nodata_value}, {clipping_geometry}, {maintain_clipping_extent})
ParameterExplanationData Type
in_raster

The raster dataset, mosaic dataset, or image service that you want to clip.

Mosaic Dataset; Mosaic Layer; Raster Dataset; Raster Layer
rectangle

Four coordinates to define the extent of the bounding box used to clip the raster 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 makes 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 name, location and format for the dataset you are creating. Make sure that it can support the necessary bit-depth.

When storing the raster dataset in a file format, you need to specify the file extension:

  • .bil—Esri BIL
  • .bip—Esri BIP
  • .bmp—BMP
  • .bsq—Esri BSQ
  • .dat—ENVI DAT
  • .gif—GIF
  • .img—ERDAS IMAGINE
  • .jpg—JPEG
  • .jp2—JPEG 2000
  • .png—PNG
  • .tif—TIFF
  • no extension for Esri Grid

When storing a raster dataset in a geodatabase, do not add a file extension to the name of the raster dataset.

When storing your raster dataset to a JPEG file, a JPEG 2000 file, a TIFF file, or a geodatabase, you can specify a Compression Type and Compression Quality in the Environment Settings.

Raster Dataset
in_template_dataset
(Optional)

A raster dataset or feature class to use as the extent. The clip output includes 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, set the clipping_geometry parameter to ClippingGeometry.This option may promote the pixel depth of the output. Therefore, you need to make sure that the output format can support the proper pixel depth.

Raster Layer; Feature Layer
nodata_value
(Optional)

The value for pixels to be considered as NoData.

String
clipping_geometry
(Optional)

Specify whether to clip your data to the minimum bounding rectangle, or to the geometry of the feature class.

  • NONE —Use the minimum bounding rectangle to clip the data. This is the default.
  • ClippingGeometry —Use the geometry of the specified feature class to clip the data. The pixel depth of the output may be increased, therefore, you need to make sure that the output format can support the proper pixel depth.
Boolean
maintain_clipping_extent
(Optional)

  • MAINTAIN_EXTENT —Adjust the number of columns and rows, then resample pixels so as to exactly match the clipping extent specified.
  • NO_MAINTAIN_EXTENT —Maintain the cell alignment as the input raster and adjust the output extent accordingly.
Boolean

Code sample

Clip example 1 (Python window)

This is a Python sample for the Clip tool.

import arcpy
arcpy.Clip_management(
    "c:/data/image.tif","1952602 294196 1953546 296176",
    "c:/data/clip.gdb/clip01", "#", "#", "NONE", "NO_MAINTAIN_EXTENT")
Clip example 2 (stand-alone script)

This is a Python script sample for the Clip tool.

##Clip Raster Dataset by known extent - Left Bottom Right Top

import arcpy
arcpy.env.workspace = "C:/Workspace"
    

arcpy.Clip_management(
    "image.tif","1952602.23 294196.279 1953546.23 296176.279",
    "clip.gdb/clip", "#", "#", "NONE")

Environments

  • Compression
  • Current Workspace
  • Extent
  • Output CONFIG Keyword
  • Output Coordinate System
  • Pyramid
  • Raster Statistics
  • Scratch Workspace
  • Snap Raster
  • Tile Size
  • Resampling Method

Licensing information

  • ArcGIS for Desktop Basic: Yes
  • ArcGIS for Desktop Standard: Yes
  • ArcGIS for Desktop Advanced: Yes

Related topics

  • An overview of the Raster toolset
  • Environment settings for raster data
  • Using the Clip button on the Image Analysis window

ArcGIS for Desktop

  • Home
  • Documentation
  • Pricing
  • Support

ArcGIS Platform

  • ArcGIS Online
  • ArcGIS for Desktop
  • ArcGIS for Server
  • ArcGIS for Developers
  • ArcGIS Solutions
  • ArcGIS Marketplace

About Esri

  • About Us
  • Careers
  • Insiders Blog
  • User Conference
  • Developer Summit
Esri
Tell us what you think.
© Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal