public sealed class Terrain : ArcGIS.Core.Data.Dataset, System.IDisposable
Public NotInheritable Class Terrain Inherits ArcGIS.Core.Data.Dataset Implements System.IDisposable
public sealed class Terrain : ArcGIS.Core.Data.Dataset, System.IDisposable
Public NotInheritable Class Terrain Inherits ArcGIS.Core.Data.Dataset Implements System.IDisposable
Terrain data is organized for fast retrieval. This organization involves the creation of terrain pyramids that are used to quickly retrieve only the data necessary to construct a surface of the required level of detail (LOD) for a given area of interest (AOI) from the database. See TerrainPyramidLevel.
public async Task OpenTerrain() { try { await ArcGIS.Desktop.Framework.Threading.Tasks.QueuedTask.Run(() => { string path = @"d:\Data\Terrain\filegdb_Containing_A_Terrain.gdb"; var fileConnection = new FileGeodatabaseConnectionPath(new Uri(path)); using (Geodatabase dataStore = new Geodatabase(fileConnection)) { string dsName = "nameOfTerrain"; using (var dataset = dataStore.OpenDataset<ArcGIS.Core.Data.Analyst3D.Terrain>(dsName)) { } } }); } catch (GeodatabaseNotFoundOrOpenedException exception) { // Handle Exception. } }
//Must be on the QueuedTask.Run() Envelope extent; SpatialReference sr; using (var tin = tinLayer.GetTinDataset()) { using (var tinDef = tin.GetDefinition()) { extent = tinDef.GetExtent(); sr = tinDef.GetSpatialReference(); } } using (var terrain = terrainLayer.GetTerrain()) { using (var terrainDef = terrain.GetDefinition()) { extent = terrainDef.GetExtent(); sr = terrainDef.GetSpatialReference(); } } using (var lasDataset = lasDatasetLayer.GetLasDataset()) { using (var lasDatasetDef = lasDataset.GetDefinition()) { extent = lasDatasetDef.GetExtent(); sr = lasDatasetDef.GetSpatialReference(); } }
//Must be on the QueuedTask.Run() var terrainCP_ds = new TerrainLayerCreationParams(terrain); terrainCP_ds.Name = "My Terrain Layer"; terrainCP_ds.IsVisible = true; //Create the layer to the terrain var terrainLayer_ds = LayerFactory.Instance.CreateLayer<TerrainLayer>(terrainCP_ds, map);
//Must be on the QueuedTask.Run() var terrainCP_renderers = new TerrainLayerCreationParams(terrain); terrainCP_renderers.Name = "My LAS Layer"; terrainCP_renderers.IsVisible = true; // define the edge type renderer - use defaults var edgeRD = new TinBreaklineRendererDefinition(); // define the face/surface renderer var faceRD = new TinFaceClassBreaksRendererDefinition(); faceRD.ClassificationMethod = ClassificationMethod.NaturalBreaks; // accept default color ramp, breakCount // define the dirty area renderer - use defaults var dirtyAreaRD = new TerrainDirtyAreaRendererDefinition(); // add renderers to dictionary var t_dict = new Dictionary<SurfaceRendererTarget, TinRendererDefinition>(); t_dict.Add(SurfaceRendererTarget.Edges, edgeRD); t_dict.Add(SurfaceRendererTarget.Surface, faceRD); t_dict.Add(SurfaceRendererTarget.DirtyArea, dirtyAreaRD); // assign dictionary to creation params terrainCP_renderers.RendererDefinitions = t_dict; //Create the layer to the terrain var terrainLayer_rd = LayerFactory.Instance.CreateLayer<TerrainLayer>(terrainCP_renderers, map);
System.Object
ArcGIS.Core.CoreObjectsBase
ArcGIS.Core.Data.Dataset
ArcGIS.Core.Data.Analyst3D.Terrain
Target Platforms: Windows 11, Windows 10