Feature Class To Feature Class (Conversion)

Summary

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

Legacy:

This is a deprecated tool. This functionality has been replaced by the Export Features tool.

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 the 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 Export option Export to save a field map as a .fieldmap file.
    • Use the Load option Import to load a .fieldmap file. The feature layer or dataset specified in the file must match the dataset used in the tool. Otherwise, the Field Map parameter will be reset.
    • Use the Slice Text button Cut 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 in Python script.

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

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

    Note:

    Converting to shapefiles 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 (False or NOT_TRANSFER_DOMAINS in Python) for best performance.

Parameters

LabelExplanationData Type
Input Features

The feature class or feature layer that will be converted.

Feature Layer
Output Location

The location where the output feature class will be created. This can be either a geodatabase or a folder. If the output location is a folder, the output will be a shapefile.

Workspace;Feature Dataset
Output Name

The name of the output feature class.

String
Expression
(Optional)

An SQL expression used to select a subset of features.

SQL Expression
Field Map
(Optional)

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

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
Configuration Keyword
(Optional)

Specifies the default storage parameters (configurations) for geodatabases in a relational database management system (RDBMS). This setting is applicable only when using enterprise geodatabase tables.

Configuration keywords are set by the database administrator.

Learn more about configuration keywords

String

Derived Output

LabelExplanationData Type
Output Feature Class

The output feature class.

Feature Class

arcpy.conversion.FeatureClassToFeatureClass(in_features, out_path, out_name, {where_clause}, {field_mapping}, {config_keyword})
NameExplanationData Type
in_features

The feature class or feature layer that will be converted.

Feature Layer
out_path

The location where the output feature class will be created. This can be either a geodatabase or a folder. If the output location is a folder, the output will be a shapefile.

Workspace;Feature Dataset
out_name

The name of the output feature class.

String
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
field_mapping
(Optional)

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

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.

In Python, use the FieldMappings class to define this parameter.

Field Mappings
config_keyword
(Optional)

Specifies the default storage parameters (configurations) for geodatabases in a relational database management system (RDBMS). This setting is applicable only when using enterprise geodatabase tables.

Configuration keywords are set by the database administrator.

Learn more about configuration keywords

String

Derived Output

NameExplanationData Type
out_feature_class

The output feature class.

Feature Class

Code sample

FeatureClassToFeatureClass example 1 (Python window)

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

import arcpy
arcpy.env.workspace = "C:/data/GreenvalleyDB.gdb/Public Buildings"
arcpy.conversion.FeatureClassToFeatureClass("buildings_point", 
                                            "C:/output/output.gdb", 
                                            "buildings_point")
FeatureClassToFeatureClass example 2 (stand-alone script)

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

# Name: FeatureClassToFeatureClass_Example2.py
# Description: Use FeatureClassToFeatureClass 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/GreenvalleyDB.gdb/Public Buildings"
 
# Set local variables
inFeatures = "buildings_point"
outLocation = "C:/output/output.gdb"
outFeatureClass = "postoffices"
delimitedField = arcpy.AddFieldDelimiters(arcpy.env.workspace, "NAME")
expression = delimitedField + " = 'Post Office'"
 
# Run FeatureClassToFeatureClass
arcpy.conversion.FeatureClassToFeatureClass(inFeatures, outLocation, 
                                            outFeatureClass, expression)

Licensing information

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