Select (Analysis) |
|
Release 9.2
Last modified January 13, 2009 |
![]() ![]() ![]() Print all topics in : "Tools" |
Extracts features from an input feature class or input feature layer and stores them in a new output feature class. The output feature class may be created with a subset of features based on a Structured Query Language (SQL) expression.
Usage tips
If no SQL expression is included, then all features will be included in the output feature class.
If a SQL expression is used but returns nothing, the output feature class will be empty.
If you use the select tool on polygons and build a query which does NOT exclude the universe polygon (ie resel int_field < AnyPositiveNumber), all polygons will be in the output cov (even the ones which your expression should exclude).
Entering this expression first "subset area > 0" will exclude the universe poly.
For details on the syntax for the Expression parameter, see Building an SQL Expression or SQL Reference.
The extent environment can be set to create an area of interest. The default is the extent of all features in the input. Specifying an extent means all features within that area of interest will be included in the output layer.
The following environment settings affect this tool: Coordinate system, Extent , XY Tolerance, Z Tolerance, M Tolerance, XY Resolution, Z Resolution, M Resolution, Output XY domain, Output Z domain, Output M , domain, Output has M values, Output has Z values, Default Z value, Configuration keyword, Output Spatial Grid.
Command line syntax
An overview of the Command Line window
Select_analysis <in_features> <out_feature_class> {where_clause}
Parameter | Explanation | Data Type |
<in_features> |
The input feature class or layer from which features are selected. |
Feature Layer |
<out_feature_class> |
The output feature class to be created. This feature class will contain all the features from the input if no expression is specified. |
Feature Class |
{where_clause} |
An SQL expression used to select a subset of features. The syntax for the expression differs slightly depending on the data source. For example, if you're querying file or ArcSDE geodatabases, shapefiles, or coverages, enclose field names in double quotes: "MY_FIELD" If you're querying personal geodatabases, enclose fields in square brackets: [MY_FIELD]. For more information on SQL syntax and how it differs between data sources, see SQL Reference. |
SQL Expression |
select_analysis D:\Workspace\wells.shp D:\Workspace\wells_Gas.shp ("WELL_TYP" = 'GAS')
Scripting syntax
About getting started with writing geoprocessing scripts
Select_analysis (in_features, out_feature_class, where_clause)
Parameter | Explanation | Data Type |
in_features (Required) |
The input feature class or layer from which features are selected. |
Feature Layer |
out_feature_class (Required) |
The output feature class to be created. This feature class will contain all the features from the input if no expression is specified. |
Feature Class |
where_clause (Optional) |
An SQL expression used to select a subset of features. The syntax for the expression differs slightly depending on the data source. For example, if you're querying file or ArcSDE geodatabases, shapefiles, or coverages, enclose field names in double quotes: "MY_FIELD" If you're querying personal geodatabases, enclose fields in square brackets: [MY_FIELD]. For more information on SQL syntax and how it differs between data sources, see SQL Reference. |
SQL Expression |
import arcgisscripting gp = arcgisscripting.create() gp.workspace = "h:/workspace" # For shapefile expression, fields are double quoted (") and text values are single quoted (') gp.select_analysis("nfroads.shp", "paved.shp", ' "ROAD_CLASS" = \'PAVED\' ')