ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Core.Data.Analyst3D Namespace / Terrain Class / GetDefinition Method
Example

In This Topic
    GetDefinition Method (Terrain)
    In This Topic
    Gets the TerrainDefinition of this terrain dataset. This method must be called on the MCT. Use QueuedTask.Run.
    Syntax
    Public Shadows Function GetDefinition() As TerrainDefinition
    public new TerrainDefinition GetDefinition()

    Return Value

    The TerrainDefinition of this terrain.
    Example
    Get a Terrain Definition
    {
      string path = @"d:\Data\Terrain\filegdb_Containing_A_Terrain.gdb";
      var fileConnection = new FileGeodatabaseConnectionPath(new Uri(path));
      //Note: Use QueuedTask.Run to run on the MCT 
      using (Geodatabase dataStore = new Geodatabase(fileConnection))
      {
        string dsName = "nameOfTerrain";
    
        using (var terrainDefinition = dataStore.GetDefinition<ArcGIS.Core.Data.Analyst3D.TerrainDefinition>(dsName))
        {
          // get the feature class names that are used in the terrain
          var fcNames = terrainDefinition.GetFeatureClassNames();
        }
      }
    }
    Retrieve dataset objects
    {
      //Note: Needs QueuedTask to run
      {
        using (var tin = tinLayer.GetTinDataset())
        {
          using var tinDef = tin.GetDefinition();
          Envelope extent = tinDef.GetExtent();
          SpatialReference sr = tinDef.GetSpatialReference();
        }
    
        using (terrain = terrainLayer.GetTerrain())
        {
          using var terrainDef = terrain.GetDefinition();
          Envelope extent = terrainDef.GetExtent();
          SpatialReference sr = terrainDef.GetSpatialReference();
        }
    
        using (lasDataset = lasDatasetLayer.GetLasDataset())
        {
          using var lasDatasetDef = lasDataset.GetDefinition();
          Envelope extent = lasDatasetDef.GetExtent();
          SpatialReference sr = lasDatasetDef.GetSpatialReference();
        }
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.2 or higher.
    See Also