Summary
Converts one or more feature classes or feature layers to geodatabase feature classes.
Usage
If the input is a layer with selected features, only those selected features will be written to the new output feature class.
The name of the output feature classes will be based on the name of the input feature class name. For example, if the input is C:\base\streams.shp, the output feature class will be named streams.
If the name already exists in the output geodatabase, a number will be appended to the end to make the feature class name unique (for example, rivers_1).
This tool does not support annotation.
Syntax
FeatureClassToGeodatabase(Input_Features, Output_Geodatabase)
Parameter | Explanation | Data Type |
Input_Features [Input_Features,...] |
One or more feature classes or feature layers to be imported into a file or enterprise geodatabase. | Feature Layer |
Output_Geodatabase |
The output or destination geodatabase. This can be a file or enterprise geodatabase. | Feature Dataset; Workspace |
Derived Output
Name | Explanation | Data Type |
Derived_Geodatabase | The geodatabase, or geodatabase feature dataset, containing the new feature classes. | Workspace; Feature Dataset |
Code sample
The following Python window script demonstrates how to use the FeatureClassToGeodatabase function in immediate mode.
import arcpy
arcpy.env.workspace = 'C:/data'
arcpy.FeatureClassToGeodatabase_conversion(['climate.shp', 'majorrds.shp'],
'C:/output/output.gdb')
The following stand-alone script demonstrates how to use the FeatureClassToGeodatabase function.
# Name: FeatureClassToGeodatabase_Example2.py
# Description: Use FeatureClassToGeodatabase to copy feature classes
# to geodatabase format
# Import modules
import arcpy
# Set environment settings
arcpy.env.workspace = 'C:/data'
# Set local variables
in_features = ['climate.shp', 'majorrds.shp']
out_location = 'C:/output/output.gdb'
# Execute FeatureClassToGeodatabase
arcpy.FeatureClassToGeodatabase_conversion(in_features, out_location)
Environments
Licensing information
- Basic: Yes
- Standard: Yes
- Advanced: Yes