Feature Class To Geodatabase (Conversion)
Summary
Converts one or more feature classes or feature layers to geodatabase feature classes.
Usage
-
The inputs can include shapefiles, coverage feature classes, VPF feature classes, or geodatabase feature classes. The inputs can also be feature layers (a layer in the ArcMap or ArcScene table of contents or a feature layer created by the Make Feature Layer tool).
-
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 it unique, for example, "_1".
-
This tool does not support annotation.
- Learn more about how to control the output feature class name with the Feature Class to Feature Class tool
Syntax
Parameter | Explanation | Data Type |
Input_Features [Input_Features,...] |
One or more feature classes or feature layers to be imported into an ArcSDE, file, or personal geodatabase. | Feature Layer |
Output_Geodatabase |
The output or destination geodatabase. This can be a file or personal geodatabase, or an ArcSDE geodatabase. | Feature Dataset; Workspace |
Code Sample
The following Python window script demonstrates how to use the FeatureClassToGeodatabase function in immediate mode.
import arcpy
from arcpy import env
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 system modules
import arcpy
from arcpy import env
# Set environment settings
env.workspace = "C:/data"
# Set local variables
inFeatures = ["climate.shp", "majorrds.shp"]
outLocation = "C:/output/output.gdb"
# Execute TableToGeodatabase
arcpy.FeatureClassToGeodatabase_conversion(inFeatures, outLocation)