Show Navigation | Hide Navigation
You are here:
Geoprocessing tool reference > Conversion toolbox > To Geodatabase toolset > Tools

Feature Class To Feature Class (Conversion)

Release 9.3
Last modified November 21, 2008
E-mail This Topic Printable Version Give Us Feedback

Print all topics in : "Tools"


Related Topics

Converts a shapefile, coverage feature class, or geodatabase feature class to a shapefile or geodatabase feature class.


Usage tips

Command line syntax
An overview of the Command Line window
FeatureclassToFeatureclass_conversion <in_Features> <out_path> <out_name> {where_clause} {field_mapping} {config_keyword}

Parameter Explanation Data Type
<in_Features>

The feature class or feature layer that will be converted.

Feature Layer
<out_path>

The location in which 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}

A 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
{field_mapping}

The fields and field contents chosen from the inputs. Each of the unique input fields will be listed on the Field Map window, and when expanded, you will see a list of all the input field occurrences (subfields). New fields can also be added.

For each Field Map, you can add, rename, or delete output fields as well as set properties such as data type and merge rule. You can also delete an output field's subfields, and you can format any output field's values if the data type is text.

Learn more about choosing and setting the output fields.

Field Mappings
{config_keyword}

Specifies the storage parameters (configuration) for geodatabases in file and ArcSDE geodatabases. Personal geodatabases do not use configuration keywords.

ArcSDE configuration keywords for ArcSDE Enterprise Edition are set up by your database administrator.

String
Data types for geoprocessing tool parameters


Command line example

FeatureclassToFeatureclass d:\geodatab\shapefiles\census\blockgrp.shp c:\geodata\portland.mdb fip410510033013 ("FIPS" = 410510033013)

FeatureclassToFeatureclass d:\geodatab\shapefiles\census\blockgrp.shp c:\geodata\portland.mdb block ("BLOCKNAME" = 'downtown')

Scripting syntax
About getting started with writing geoprocessing scripts
FeatureclassToFeatureclass_conversion (in_Features, out_path, out_name, where_clause, field_mapping, config_keyword)

Parameter Explanation Data Type
in_Features (Required)

The feature class or feature layer that will be converted.

Feature Layer
out_path (Required)

The location in which 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 (Required)

The name of the output feature class.

String
where_clause (Optional)

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

The fields and field contents chosen from the inputs. Each of the unique input fields will be listed on the Field Map window, and when expanded, you will see a list of all the input field occurrences (subfields). New fields can also be added.

For each Field Map, you can add, rename, or delete output fields as well as set properties such as data type and merge rule. You can also delete an output field's subfields, and you can format any output field's values if the data type is text.

Learn more about choosing and setting the output fields.

Field Mappings
config_keyword (Optional)

Specifies the storage parameters (configuration) for geodatabases in file and ArcSDE geodatabases. Personal geodatabases do not use configuration keywords.

ArcSDE configuration keywords for ArcSDE Enterprise Edition are set up by your database administrator.

String

Data types for geoprocessing tool parameters


Script example

# FeatureClassToFeatureClassExample.py
# Description: Converts a shapefile to a geodatabase
# Requirement: None
# Author: ESRI
# Date: 12/12/03

# Create the Geoprocessor object
import arcgisscripting
gp = arcgisscripting.create()

# Set some local variables
inFC= "C:/data/roads.shp"
outLocation = "C:/data/myPGDB.mdb"
outFCName = "NF_Roads"
expression = " \"ROADS_CODE\" = \'one\' "

# Use error trapping in case an error occurs during conversion
try:
    # Process: FeatureClass To FeatureClass...
    gp.FeatureClassToFeatureClass_conversion(inFC, outLocation, outFCName, expression)

except:
    print "An error occurred"
    print gp.GetMessages()

Please visit the Feedback page to comment or give suggestions on ArcGIS Desktop Help.
Copyright © Environmental Systems Research Institute, Inc.