ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Core.Data Namespace / FeatureDatasetDefinition Class
Members Example

In This Topic
    FeatureDatasetDefinition Class
    In This Topic
    Represents the properties of a FeatureDataset.
    Object Model
    FeatureDatasetDefinition ClassEnvelope ClassSpatialReference Class
    Syntax
    public sealed class FeatureDatasetDefinition : Definition, System.IDisposable  
    Public NotInheritable Class FeatureDatasetDefinition 
       Inherits Definition
       Implements System.IDisposable 
    Example
    Obtaining Definition from Geodatabase
    public async Task ObtainingDefinitionFromGeodatabase()
    {
      await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
      {
        using (Geodatabase geodatabase = new Geodatabase(new DatabaseConnectionFile(new Uri("path\\to\\sde\\file\\sdefile.sde"))))
        {
          // Remember that for Enterprise databases you have to qualify your dataset names with the DatabaseName and UserName.
          TableDefinition enterpriseTableDefinition = geodatabase.GetDefinition<TableDefinition>("LocalGovernment.GDB.CitizenContactInfo");
    
          // It does not matter if the dataset is within a FeatureDataset or not.
          FeatureClassDefinition featureClassDefinition = geodatabase.GetDefinition<FeatureClassDefinition>("LocalGovernment.GDB.FireStation");
    
          // GetDefinition For a RelationshipClass.
          RelationshipClassDefinition relationshipClassDefinition = geodatabase.GetDefinition<RelationshipClassDefinition>("LocalGovernment.GDB.AddressPointHasSiteAddresses");
    
          // GetDefinition For a FeatureDataset.
          FeatureDatasetDefinition featureDatasetDefinition = geodatabase.GetDefinition<FeatureDatasetDefinition>("LocalGovernment.GDB.Address");
        }
      });
    }
    Obtaining List of Defintions from Geodatabase
    public async Task ObtainingDefinitionsFromGeodatabase()
    {
      await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() =>
      {
        using (Geodatabase geodatabase = new Geodatabase(
          new DatabaseConnectionFile(new Uri("path\\to\\sde\\file\\sdefile.sde"))))
        {
          var enterpriseDefinitions = 
            geodatabase.GetDefinitions<FeatureClassDefinition>();
          IEnumerable<Definition> featureClassesHavingGlobalID = 
            enterpriseDefinitions.Where(definition => definition.HasGlobalID());
    
          var featureDatasetDefinitions = 
            geodatabase.GetDefinitions<FeatureDatasetDefinition>();
          bool electionRelatedFeatureDatasets = 
            featureDatasetDefinitions.Any(
              definition => definition.GetName().Contains("Election"));
    
          var attributedRelationshipClassDefinitions = 
            geodatabase.GetDefinitions<AttributedRelationshipClassDefinition>();
    
          var relationshipClassDefinitions = 
            geodatabase.GetDefinitions<RelationshipClassDefinition>();
        }
      });
    }
    Deleting a FeatureDataset
    // Deleting a FeatureDataset named as 'Parcel_Information'
    
    FeatureDatasetDefinition featureDatasetDefinition = geodatabase.GetDefinition<FeatureDatasetDefinition>("Parcel_Information");
    FeatureDatasetDescription featureDatasetDescription = 
      new FeatureDatasetDescription(featureDatasetDefinition);
    
    SchemaBuilder schemaBuilder = new SchemaBuilder(geodatabase);
    
    // Delete an existing feature dataset named as 'Parcel_Information'
    schemaBuilder.Delete(featureDatasetDescription);
    schemaBuilder.Build();
    
    Inheritance Hierarchy

    System.Object
       ArcGIS.Core.CoreObjectsBase
          ArcGIS.Core.Data.Definition
             ArcGIS.Core.Data.FeatureDatasetDefinition

    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also