Feature Class To Shapefile (Conversion)

Summary

Converts the features from one or more feature classes or feature layers to shapefiles and adds them to a folder of shapefiles.

Usage

  • Shapefiles have many limitations compared to feature classes in a geodatabase. For example, shapefile attributes cannot store null values, they round up numbers, they have poor support for Unicode character strings, they do not allow field names longer than 10 characters, and they cannot store both a date and time in a field. Additionally, they do not support capabilities found in geodatabases such as domains and subtypes.

    Learn more about shapefile limitations

  • The name of the output shapefile will be the name of the input feature class. For example, if the input is C:\base.gdb\rivers, the output shapefile will be named rivers.shp. To control the output shapefile name and for additional conversion options, see the Export Features tool.

  • If the name of an output shapefile already exists in the output folder, and the Allow geoprocessing tools to overwrite existing datasets option is unchecked, a number will be appended to the end to make the shapefile name unique (for example, rivers_1.shp). If any of the input feature classes have the same name, a number will also be appended to the output shapefile names, regardless of the overwrite existing datasets option. Otherwise, the shapefile will be overwritten.

Parameters

LabelExplanationData Type
Input Features

The list of input feature classes or feature layers that will be converted and added to the output folder.

Feature Layer
Output Folder

The folder where the shapefiles will be written.

Folder

Derived Output

LabelExplanationData Type
Updated Output Folder

The folder containing the new shapefiles.

Folder

arcpy.conversion.FeatureClassToShapefile(Input_Features, Output_Folder)
NameExplanationData Type
Input_Features
[Input_Features,...]

The list of input feature classes or feature layers that will be converted and added to the output folder.

Feature Layer
Output_Folder

The folder where the shapefiles will be written.

Folder

Derived Output

NameExplanationData Type
Derived_Folder

The folder containing the new shapefiles.

Folder

Code sample

FeatureClassToShapefile example 1 (Python window)

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

import arcpy
arcpy.env.workspace = "C:/data/airport.gdb"
arcpy.conversion.FeatureClassToShapefile(["county", "parcels", "schools"],
                                         "C:/output")
FeatureClassToShapefile example 2 (stand-alone script)

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

# Name: FeatureClassToShapefile_Example2.py
# Description: Use FeatureClassToShapefile to convert feature classes to shapefiles.

# Import system modules
import arcpy
 
# Set environment settings
arcpy.env.workspace = "C:/data"
 
# Set local variables
inFeatures = ["climate.shp", "majorrds.shp"]
outLocation = "C:/output"
 
# Run FeatureClassToShapefile
arcpy.conversion.FeatureClassToShapefile(inFeatures, outLocation)

Licensing information

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

Related topics