Export Features (Conversion)

Summary

Converts a feature class or feature layer to a new feature class.

Usage

  • Use the Field Map parameter to manage the fields and their content in the output dataset.

    • Add and remove fields from the fields list, reorder the fields list, and rename fields.
    • The default data type of an output field is the same as the data type of the first input field (of that name) it encounters. You can change the data type to another valid data type.
    • Use an action to determine how values from one or multiple input fields will be merged into a single output field. The available actions are First, Last, Concatenate, Sum, Mean, Median, Mode, Minimum, Maximum, Standard Deviation, and Count.
    • When using the Concatenate action, you can specify a delimiter such as a comma or other characters. Click the start of the Delimiter text box to add the delimiter characters.
    • Standard Deviation is not a valid option for single input values.
    • Use the Slice Text button on text source fields to choose which characters from an input value will be extracted to the output field. To access the Slice Text button, hover over a text field in the input fields list; then specify the start and end character positions.
    • Fields can also be mapped using Python scripts.

  • An SQL expression can be used to select a subset of features. For more information about the syntax for the Expression parameter, see SQL reference for query expressions used in ArcGIS.

  • Rows can be reordered in ascending or descending order by specifying the Sort Field parameter value. If more than one field is specified, rows will be sorted by the first field, and within that order, by the second field, and so on.

  • When converting geodatabase data that has subtypes or domains and the output workspace is not a geodatabase, both the subtype and domain codes and descriptions can be included in the output. Use the Transfer field domain descriptions environment to control this behavior. By default, only domain and subtype codes will be included in the output, not descriptions.

    Note:

    Conversion to a shapefile with subtype and domain descriptions may take more time (slower performance) than without descriptions. If subtype and domain descriptions are not required in the output, leave the Transfer field domain descriptions environment unchecked for best performance.

Parameters

LabelExplanationData Type
Input Features

The input features that will be exported to a new feature class.

Feature Layer
Output Feature Class

The output feature class containing the exported features.

Feature Class
Expression
(Optional)

An SQL expression used to select a subset of features.

SQL Expression
Use Field Alias as Name
(Optional)

Specifies whether the input's field names or field aliases will be used as the output field name.

  • Unchecked—The input's field names will be used as the output field names. This is the default.
  • Checked—The input's field aliases will be used as the output field names.
Boolean
Field Map
(Optional)

The fields that will be transferred to the output dataset with their respective properties and source fields. By default, the output includes all fields from the input dataset.

Use the field map to add, delete, rename, and reorder fields, as well as change other field properties.

The field map can also be used to combine values from two or more input fields into a single output field.

Field Mappings
Sort Field
(Optional)

The field or fields whose values will be used to reorder the input records and the direction the records will be sorted.

  • Ascending—Records will be sorted from low value to high value.
  • Descending—Records will be sorted from high value to low value.

Value Table

arcpy.conversion.ExportFeatures(in_features, out_features, {where_clause}, {use_field_alias_as_name}, {field_mapping}, {sort_field})
NameExplanationData Type
in_features

The input features that will be exported to a new feature class.

Feature Layer
out_features

The output feature class containing the exported features.

Feature Class
where_clause
(Optional)

An SQL expression used to select a subset of features. For more information on SQL syntax see the help topic SQL reference for query expressions used in ArcGIS.

SQL Expression
use_field_alias_as_name
(Optional)

Specifies whether the input's field names or field aliases will be used as the output field name.

  • NOT_USE_ALIASThe input's field names will be used as the output field names. This is the default.
  • USE_ALIASThe input's field aliases will be used as the output field names.
Boolean
field_mapping
(Optional)

The fields that will be transferred to the output dataset with their respective properties and source fields. By default, the output includes all fields from the input dataset.

Use the field map to add, delete, rename, and reorder fields, as well as change other field properties.

The field map can also be used to combine values from two or more input fields into a single output field.

Field Mappings
sort_field
[sort_field,...]
(Optional)

The field or fields whose values will be used to reorder the input records and the direction the records will be sorted.

  • ASCENDING—Records will be sorted from low value to high value.
  • DESCENDING—Records will be sorted from high value to low value.

Value Table

Code sample

ExportFeatures example 1 (Python window)

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

import arcpy
arcpy.env.workspace = "C:/data/SFValley.gdb"
arcpy.conversion.ExportFeatures("streets", "C:/output/output.gdb/streets")
ExportFeatures example 2 (stand-alone script)

The following stand-alone script demonstrates how to use the ExportFeatures function.

# Name: ExportFeatures_Example2.py
# Description: Use Export Features with an expression to create a subset of the
# original feature class.

# Import system modules

import arcpy

# Set environment settings
arcpy.env.workspace = "C:/data/SFValley.gdb"

# Set local variables
inFeatures = "streets"
outFeatureClass =  "C:/output/output.gdb/arterials"
expression = arcpy.AddFieldDelimiters(arcpy.env.workspace, "Category") + " = 'Arterials'"

# Run ExportFeatures
arcpy.conversion.ExportFeatures(inFeatures, outFeatureClass, expression,
                               "NOT_USE_ALIAS")

Related topics