ArcGIS Pro 3.1 API Reference Guide
ArcGIS.Core.Data.DDL Namespace / SchemaBuilder Class / Create Method / Create(FeatureDatasetDescription,FeatureClassDescription) Method
Indicates the ArcGIS.Core.Data.FeatureDataset where the ArcGIS.Core.Data.FeatureClass will be created.
Indicates the ArcGIS.Core.Data.FeatureClass to be created.
Example

In This Topic
    Create(FeatureDatasetDescription,FeatureClassDescription) Method
    In This Topic
    Enqueue the create operation on the object referred to by the FeatureClassDescription.
    Syntax

    Parameters

    featureDatasetDescription
    Indicates the ArcGIS.Core.Data.FeatureDataset where the ArcGIS.Core.Data.FeatureClass will be created.
    featureClassDescription
    Indicates the ArcGIS.Core.Data.FeatureClass to be created.

    Return Value

    Exceptions
    ExceptionDescription

    The ArcGIS.Core.Geometry.SpatialReference of the featureDatasetDescription and the featureClassDescription do not match.

    -or-

    The total path length for the ArcGIS.Core.Data.FeatureClass to be created must be less than 252 characters.

    featureDatasetDescription and/or featureClassDescription is null.
    Memory ArcGIS.Core.Data.Geodatabase does not support feature datasets.
    Example
    Creating a FeatureDataset with a FeatureClass in one operation
    public void CreateFeatureDatasetWithFeatureClassSnippet(Geodatabase geodatabase)
    {
      // Creating a FeatureDataset named as 'Parcel_Information' and a FeatureClass with name 'Parcels' in one operation
    
      string featureDatasetName = "Parcel_Information";
      string featureClassName = "Parcels";
    
      SchemaBuilder schemaBuilder = new SchemaBuilder(geodatabase);
    
      // Create a FeatureDataset token
      FeatureDatasetDescription featureDatasetDescription = new FeatureDatasetDescription(featureDatasetName, SpatialReferences.WGS84);
      FeatureDatasetToken featureDatasetToken = schemaBuilder.Create(featureDatasetDescription);
    
      // Create a FeatureClass description
      FeatureClassDescription featureClassDescription = new FeatureClassDescription(featureClassName,
        new List<FieldDescription>()
        {
          new FieldDescription("Id", FieldType.Integer),
          new FieldDescription("Address", FieldType.String)
        },
        new ShapeDescription(GeometryType.Point, SpatialReferences.WGS84));
    
      // Create a FeatureClass inside a FeatureDataset
      FeatureClassToken featureClassToken = schemaBuilder.Create(new FeatureDatasetDescription(featureDatasetToken), featureClassDescription);
    
      // Build status
      bool buildStatus = schemaBuilder.Build();
    
      // Build errors
      if (!buildStatus)
      {
        IReadOnlyList<string> errors = schemaBuilder.ErrorMessages;
      }
    }
    Creating a FeatureClass in existing FeatureDataset
    public void CreateFeatureClassInsideFeatureDatasetSnippet(Geodatabase geodatabase)
    {
      // Creating a FeatureClass named as 'Tax_Jurisdiction' in existing FeatureDataset with name 'Parcels_Information'
      string featureDatasetName = "Parcels_Information";
      string featureClassName = "Tax_Jurisdiction";
    
      // Create a FeatureClass description
      FeatureClassDescription featureClassDescription = new FeatureClassDescription(featureClassName,
        new List<FieldDescription>()
        {
          new FieldDescription("Tax_Id", FieldType.Integer),
          new FieldDescription("Address", FieldType.String)
        },
        new ShapeDescription(GeometryType.Point, SpatialReferences.WGS84));
    
      FeatureDatasetDefinition featureDatasetDefinition = geodatabase.GetDefinition<FeatureDatasetDefinition>(featureDatasetName);
    
      SchemaBuilder schemaBuilder = new SchemaBuilder(geodatabase);
    
      // Create a FeatureClass inside a FeatureDataset using a FeatureDatasetDefinition
      schemaBuilder.Create(new FeatureDatasetDescription(featureDatasetDefinition), featureClassDescription);
    
      // Build status
      bool buildStatus = schemaBuilder.Build();
    
      // Build errors
      if (!buildStatus)
      {
        IReadOnlyList<string> errors = schemaBuilder.ErrorMessages;
      }
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3.0 or higher.
    See Also