ArcGIS for Desktop

  • Documentation
  • Pricing
  • Support

  • My Profile
  • Help
  • Sign Out
ArcGIS for Desktop

ArcGIS Online

The mapping platform for your organization

ArcGIS for Desktop

A complete professional GIS

ArcGIS for Server

GIS in your enterprise

ArcGIS for Developers

Tools to build location-aware apps

ArcGIS Solutions

Free template maps and apps for your industry

ArcGIS Marketplace

Get apps and data for your organization

  • Documentation
  • Pricing
  • Support
Esri
  • Sign In
user
  • My Profile
  • Sign Out

Help

  • Home
  • Get Started
  • Map
  • Analyze
  • Manage Data
  • Tools
  • More...

Create Feature Dataset

  • Summary
  • Syntax
  • Code sample
  • Environments
  • Licensing information

Summary

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

Usage

    Syntax

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

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

    Workspace
    out_name

    The name of the feature dataset to be created.

    String
    spatial_reference
    (Optional)

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

    • By entering the path to a .prj file, such as C:/workspace/watershed.prj.
    • By referencing a feature class or feature dataset whose spatial reference you want to apply, such as C:/workspace/myproject.gdb/landuse/grassland.
    • By defining 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

    Code sample

    CreateFeatureDataset Example 1 (Python Window)

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

    import arcpy
    from arcpy import env
    
    env.workspace = "C:/data"
    arcpy.CreateFileGDB_management("C:/output", "HabitatAnalysis.gdb")
    arcpy.CreateFeatureDataset_management("C:/output/HabitatAnalysis.gdb", "analysisresults", "C:/workspace/landuse.prj")
    
    CreateFeatureDataset Example 2 (stand-alone Python Script)

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

    # Name: CreateFeaturedataset _Example2.py
    # Description: Create a feature dataset 
    
    # Import system modules
    import arcpy
    from arcpy import env
    
    # Set workspace
    env.workspace = "C:/data"
    
    # 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)
    

    Environments

    • Current Workspace
    • Output Coordinate System
    • XY Resolution
    • XY Tolerance
    • M Resolution
    • M Tolerance
    • Z Resolution
    • Z Tolerance

    Licensing information

    • ArcGIS for Desktop Basic: Yes
    • ArcGIS for Desktop Standard: Yes
    • ArcGIS for Desktop Advanced: Yes

    Related topics

    • An overview of the Workspace toolset

    ArcGIS for Desktop

    • Home
    • Documentation
    • Pricing
    • Support

    ArcGIS Platform

    • ArcGIS Online
    • ArcGIS for Desktop
    • ArcGIS for Server
    • ArcGIS for Developers
    • ArcGIS Solutions
    • ArcGIS Marketplace

    About Esri

    • About Us
    • Careers
    • Insiders Blog
    • User Conference
    • Developer Summit
    Esri
    Tell us what you think.
    © Copyright 2016 Environmental Systems Research Institute, Inc. | Privacy | Legal