Clip (Analysis)

Summary

Extracts input features that overlay the clip features.

Use this tool to cut out a piece of one dataset using one or more of the features in another dataset as a cookie cutter. This is particularly useful for creating a new dataset—also referred to as study area or area of interest (AOI)—that contains a geographic subset of the features in another, larger dataset.

An alternate tool is available for clip operations. See the Pairwise Clip tool for details.

Illustration

Clip tool illustration

Usage

  • The Clip Features parameter values can be points, lines, and polygons, depending on the Input Features or Dataset parameter type.

    • When the Input Features or Dataset values are polygons, the Clip Features values must also be polygons.
    • When the Input Features or Dataset values are lines, the Clip Features values 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 or Dataset values are points, the Clip Features values 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.
    • When the Input Features or Dataset values are an integrated mesh scene layer or scene layer package, the Clip Features values must also be polygons.

  • The Output Features or Dataset parameter will contain all the attributes of the Input Features or Dataset parameter when the output is a feature class.

  • Integrated mesh scene layer packages must use I3S version 1.6 and later to be used as input. Use the Upgrade Scene Layer tool to upgrade pre-1.6 version scene layer packages. The output scene layer package will be in the latest I3S version.

  • 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:

    Line features clipped by polygon features

  • Point features clipped by polygon features:

    Point features clipped by polygon features

  • Line features clipped with line features:

    Line features clipped with line features

  • Point features clipped with point 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.

    Caution:

    Geoprocessing tools do not honor geodatabase feature class or table field split policies.

  • This tool honors the Parallel Processing Factor environment. If the environment is not set (the default) or is set to 0, parallel processing will be disabled. Setting the environment to 100 will enable parallel processing. Up to 10 cores will be used when parallel processing is enabled.

Parameters

LabelExplanationData Type
Input Features or Dataset

The features to be clipped.

Feature Layer; Scene Layer; File
Clip Features

The features to use to clip the input features.

Feature Layer
Output Features or Dataset

The dataset to be created.

Feature Class; File
XY 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 higher for data with less coordinate accuracy and lower for data with extremely high accuracy.

Caution:

Changing this parameter's value may cause failure or unexpected results. It is recommended that this parameter not be modified. It has been removed from view in the tool dialog. By default, the input feature class's spatial reference x,y tolerance property is used.

Linear Unit

arcpy.analysis.Clip(in_features, clip_features, out_feature_class, {cluster_tolerance})
NameExplanationData Type
in_features

The features to be clipped.

Feature Layer; Scene Layer; File
clip_features

The features to use to clip the input features.

Feature Layer
out_feature_class

The dataset to be created.

Feature Class; File
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 higher for data with less coordinate accuracy and lower for data with extremely high accuracy.

Caution:

Changing this parameter's value may cause failure or unexpected results. It is recommended that this parameter not be modified. It has been removed from view in the tool dialog. By default, the input feature class's spatial reference x,y tolerance property is used.

Linear Unit

Code sample

Clip example 1 (Python window)

The following Python window script demonstrates how to use the Clip function in immediate mode.

import arcpy
arcpy.env.workspace = "C:/data"
arcpy.Clip_analysis("majorrds.shp", "study_quads.shp", 
                    "C:/output/studyarea.shp")
Clip example 2 (Python window)

The following Python window script demonstrates how to use the Clip function with a scene layer.

import arcpy
arcpy.env.workspace = "C:/data"
arcpy.Clip_analysis("campus.slpk", "building_footprint.shp", 
                    "C:/output/AreaOfInterest.slpk")
Clip example 3 (stand-alone 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

# Set workspace
arcpy.env.workspace = "C:/data"

# Set local variables
in_features = "majorrds.shp"
clip_features = "study_quads.shp"
out_feature_class = "C:/output/studyarea.shp"

# Execute Clip
arcpy.Clip_analysis(in_features, clip_features, out_feature_class)

Licensing information

  • Basic: Yes
  • Standard: Yes
  • Advanced: Yes

Related topics