Summary
Extracts input features that overlay the clip features.
Use this tool to cut out a piece of one feature class using one or more of the features in another feature class as a cookie cutter. This is particularly useful for creating a new feature class—also referred to as study area or area of interest (AOI)—that contains a geographic subset of the features in another, larger feature class.
Illustration
Usage
The Clip Features can be points, lines, and polygons, depending on the Input Features type.
- When the Input Features are polygons, the Clip Features must also be polygons.
- When the Input Features are lines, the Clip Features can be lines or polygons. When clipping line features with line features, only the coincident lines or line segments are written to the output, as shown in the graphic below.
- When the Input Features are points, the Clip Features can be points, lines, or polygons. When clipping point features with point features, only the coincident points are written to the output, as shown in the graphic below. When clipping point features with line features, only the points that are coincident with the line features are written to the output.
The Output Feature Class will contain all the attributes of the Input Features.
This tool will use a tiling process to handle very large datasets for better performance and scalability. For more details, see Geoprocessing with large datasets.
Line features clipped by polygon features:
Point features clipped by polygon features:
Line features clipped with line features:
Point features clipped with point features:
Attribute values from the input feature classes will be copied to the output feature class. However, if the input is a layer or layers created by the Make Feature Layer tool and a field's Use Ratio Policy is checked, then a ratio of the input attribute value is calculated for the output attribute value. When Use Ratio Policy is enabled, whenever a feature in an overlay operation is split, the attributes of the resulting features are a ratio of the attribute value of the input feature. The output value is based on the ratio in which the input feature geometry was divided. For example, if the input geometry was divided equally, each new feature's attribute value is assigned one-half of the value of the input feature's attribute value. Use Ratio Policy only applies to numeric field types.
Syntax
Clip(in_features, clip_features, out_feature_class, {cluster_tolerance})
Parameter | Explanation | Data Type |
in_features | The features to be clipped. | Feature Layer |
clip_features | The features used to clip the input features. | Feature Layer |
out_feature_class | The feature class to be created. | Feature Class |
cluster_tolerance (Optional) | The minimum distance separating all feature coordinates as well as the distance a coordinate can move in X or Y (or both). Set the value to be higher for data with less coordinate accuracy and lower for data with extremely high accuracy. | Linear unit |
Code sample
Clip example (Python window)
The following Python window script demonstrates how to use the Clip function in immediate mode.
import arcpy
from arcpy import env
env.workspace = "C:/data"
arcpy.Clip_analysis("majorrds.shp", "study_quads.shp", "C:/output/studyarea.shp")
Clip example 2 (stand-alone Python script)
The following Python script demonstrates how to use the Clip function in a stand-alone script.
# Name: Clip_Example2.py
# Description: Clip major roads that fall within the study area.
# Import system modules
import arcpy
from arcpy import env
# Set workspace
env.workspace = "C:/data"
# Set local variables
in_features = "majorrds.shp"
clip_features = "study_quads.shp"
out_feature_class = "C:/output/studyarea.shp"
xy_tolerance = ""
# Execute Clip
arcpy.Clip_analysis(in_features, clip_features, out_feature_class, xy_tolerance)
Environments
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes