Create Feature Dataset (Data Management)


Creates a feature dataset in the output location—an existing enterprise or file geodatabase.


  • A feature dataset is a collection of related feature classes that share a common coordinate system. Feature datasets are used for organizing related feature classes into a common dataset for building a topology, network dataset, terrain, geometric network, or parcel fabric.


CreateFeatureDataset(out_dataset_path, out_name, {spatial_reference})
ParameterExplanationData Type

The enterprise or file geodatabase in which the output feature dataset will be created.


The name of the feature dataset to be created.


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.

Spatial Reference

Derived Output

NameExplanationData Type

The new output feature dataset.

Feature Dataset

Code sample

CreateFeatureDataset example 1 (Python window)

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

import arcpy
arcpy.CreateFileGDB_management("C:/output", "HabitatAnalysis.gdb")
CreateFeatureDataset example 2 (stand-alone script)

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

# Name:
# Description: Create a feature dataset 

# Import system modules
import arcpy

# Set local variables
out_dataset_path = "C:/output/HabitatAnalysis.gdb" 
out_name = "analysisresults"

# Creating a spatial reference object
sr = arcpy.SpatialReference("C:/data/studyarea.prj")

# Create a FileGDB for the fds
arcpy.CreateFileGDB_management("C:/output", "HabitatAnalysis.gdb")

# Execute CreateFeaturedataset 
arcpy.CreateFeatureDataset_management(out_dataset_path, out_name, sr)

Licensing information

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

Related topics