Select

Titleā€ƒ Select

Summary

Geoprocessing tool that uses a select expression to extract features from one feature class and output them to a new feature class.


Usage


Syntax

Parameter Explanation
in_features

The input feature class or layer from which features are selected.

out_feature_class (Optional)

The output feature class to be created. If no expression is used, it contains all input features.

where_clause (Optional)

An SQL expression used to select a subset of features.

esri_out_feature_service_name (Optional)

The name of the optional feature service to create on the federated server containing the result of this tool. If no name is specified an output feature service will not be created.

Code Samples

Select example 1 (Python window)

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


import arcpy
arcpy.env.workspace = "C:/data"
arcpy.Select_analysis("majorrds.shp", "C:/output/majorrdsClass4.shp", '"CLASS" = \'4\'')

                    

Select example 2 (stand-alone script)

The following Python script demonstrates how to use the Select function in a stand-alone script.


# Name: Select_Example2.py
# Description: Select roads of Class 4 from major roads tin the gnatcatcher habitat study area

# Import system modules
import arcpy

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

# Set local variables
in_features = "majorrds.shp"
out_feature_class = "C:/output/majorrdsClass4.shp"
where_clause = '"CLASS" = \'4\''

# Execute Select
arcpy.Select_analysis(in_features, out_feature_class, where_clause)

                    

Tags

Credits

Use limitations