Create Feature Class (Data Management)

Summary

Creates an empty feature class in a geodatabase or a shapefile in a folder.

Usage

  • The Feature Class Location parameter value (geodatabase or folder) must already exist.

  • This tool creates only simple feature classes such as point, multipoint, polygon, and polyline.

  • A shapefile created by this tool has an integer field named ID. The ID field is not created when you provide a Template Dataset parameter value.

Parameters

LabelExplanationData Type
Feature Class Location

The enterprise or file geodatabase or the folder in which the output feature class will be created. This workspace must already exist.

Workspace; Feature Dataset
Feature Class Name

The name of the feature class to be created.

String
Geometry Type
(Optional)

Specifies the geometry type of the feature class.

  • PointThe geometry type is point.
  • MultipointThe geometry type is multipoint.
  • PolygonThe geometry type is polygon.
  • PolylineThe geometry type is polyline.
  • MultipatchThe geometry type is multipatch.
String
Template Dataset
(Optional)

The feature class or table used as a template to define the attribute fields of the new feature class.

Table View
Has M
(Optional)

Specifies whether the feature class contains linear measurement values (m-values).

  • NoThe output feature class will not have M-values. This is the default.
  • YesThe output feature class will have M-values.
  • Same as the template feature classThe output feature class will have M-values if the dataset specified in the Template Feature Class parameter (template parameter in Python) has M-values.
String
Has Z
(Optional)

Specifies whether the feature class contains elevation values (z-values).

  • NoThe output feature class will not have Z-values. This is the default.
  • YesThe output feature class will have Z-values.
  • Same as the template feature classThe output feature class will have Z-values if the dataset specified in the Template Feature Class parameter (template parameter in Python) has Z-values.
String
Coordinate System
(Optional)

The spatial reference of the output feature dataset. On the Spatial Reference Properties dialog box, you can select, import, or create a new coordinate system. To set aspects of the spatial reference, such as the x,y-, z-, or m-domain, resolution, or tolerance, use the Environments dialog box.

If a spatial reference is not provided, the output will have an undefined spatial reference.

Note:

The spatial reference of the Template Feature Class has no effect on the output spatial reference. If you want your output to be in the coordinate system of the Template Feature Class, set the Coordinate System parameter to the spatial reference of the Template Feature Class.

Spatial Reference
Configuration Keyword
(Optional)

The configuration keyword applies to enterprise geodatabase data only. It determines the storage parameters of the database table.

String
Output Spatial Grid 1
(Optional)

This parameter has been deprecated in ArcGIS Pro. Any value you enter is ignored.

Double
Output Spatial Grid 2
(Optional)

This parameter has been deprecated in ArcGIS Pro. Any value you enter is ignored.

Double
Output Spatial Grid 3
(Optional)

This parameter has been deprecated in ArcGIS Pro. Any value you enter is ignored.

Double
Feature Class Alias
(Optional)

The alternate name for the output feature class that will be created.

String

Derived Output

LabelExplanationData Type
Output Feature Class

The new feature class.

Feature Class

arcpy.management.CreateFeatureclass(out_path, out_name, {geometry_type}, {template}, {has_m}, {has_z}, {spatial_reference}, {config_keyword}, {spatial_grid_1}, {spatial_grid_2}, {spatial_grid_3}, {out_alias})
NameExplanationData Type
out_path

The enterprise or file geodatabase or the folder in which the output feature class will be created. This workspace must already exist.

Workspace; Feature Dataset
out_name

The name of the feature class to be created.

String
geometry_type
(Optional)

Specifies the geometry type of the feature class.

  • POINTThe geometry type is point.
  • MULTIPOINTThe geometry type is multipoint.
  • POLYGONThe geometry type is polygon.
  • POLYLINEThe geometry type is polyline.
  • MULTIPATCHThe geometry type is multipatch.
String
template
[template,...]
(Optional)

The feature class or table used as a template to define the attribute fields of the new feature class.

Table View
has_m
(Optional)

Specifies whether the feature class contains linear measurement values (m-values).

  • DISABLEDThe output feature class will not have M-values. This is the default.
  • ENABLEDThe output feature class will have M-values.
  • SAME_AS_TEMPLATEThe output feature class will have M-values if the dataset specified in the Template Feature Class parameter (template parameter in Python) has M-values.
String
has_z
(Optional)

Specifies whether the feature class contains elevation values (z-values).

  • DISABLEDThe output feature class will not have Z-values. This is the default.
  • ENABLEDThe output feature class will have Z-values.
  • SAME_AS_TEMPLATEThe output feature class will have Z-values if the dataset specified in the Template Feature Class parameter (template parameter in Python) has Z-values.
String
spatial_reference
(Optional)

The spatial reference of the output feature dataset. You can specify the spatial reference in the following ways:

  • Enter the path to a .prj file, such as C:/workspace/watershed.prj.
  • Reference a feature class or feature dataset whose spatial reference you want to apply, such as C:/workspace/myproject.gdb/landuse/grassland.
  • Define a spatial reference object prior to using this tool, such as sr = arcpy.SpatialReference("C:/data/Africa/Carthage.prj"), which you then use as the spatial reference parameter.

If a spatial reference is not provided, the output will have an undefined spatial reference.

Note:

The spatial reference of the Template Feature Class has no effect on the output spatial reference. If you want your output to be in the coordinate system of the Template Feature Class, set the Coordinate System parameter to the spatial reference of the Template Feature Class.

Spatial Reference
config_keyword
(Optional)

The configuration keyword applies to enterprise geodatabase data only. It determines the storage parameters of the database table.

String
spatial_grid_1
(Optional)

This parameter has been deprecated in ArcGIS Pro. Any value you enter is ignored.

Double
spatial_grid_2
(Optional)

This parameter has been deprecated in ArcGIS Pro. Any value you enter is ignored.

Double
spatial_grid_3
(Optional)

This parameter has been deprecated in ArcGIS Pro. Any value you enter is ignored.

Double
out_alias
(Optional)

The alternate name for the output feature class that will be created.

String

Derived Output

NameExplanationData Type
out_feature_class

The new feature class.

Feature Class

Code sample

CreateFeatureclass example (Python window)

The following Python Window script demonstrates how to use the CreateFeatureclass function in immediate mode.

import arcpy
arcpy.env.workspace = "C:/data"
arcpy.CreateFeatureclass_management("C:/output", "habitatareas.shp", "POLYGON", 
                                    "study_quads.shp", "DISABLED", "DISABLED", 
                                    "C:/workspace/landuse.shp")
CreateFeatureclass example 2 (stand-alone script)

The following Python script demonstrates how to use the CreateFeatureclass function in a stand-alone script.

# Name: CreateFeatureclass_Example2.py
# Description: Create a feature class to store the gnatcatcher habitat zones

# Import system modules
import arcpy

# Set workspace
arcpy.env.workspace = "C:/data"

# Set local variables
out_path = "C:/output"
out_name = "habitatareas.shp"
geometry_type = "POLYGON"
template = "study_quads.shp"
has_m = "DISABLED"
has_z = "DISABLED"

# Use Describe to get a SpatialReference object
spatial_ref = arcpy.Describe("C:/workspace/studyarea.shp").spatialReference

# Execute CreateFeatureclass
arcpy.CreateFeatureclass_management(out_path, out_name, geometry_type, template, 
                                    has_m, has_z, spatial_ref)

Licensing information

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

Related topics