Public Function GetDefinition(Of T As Definition)( _ ByVal name As String _ ) As T
public T GetDefinition<T>( string name ) where T: Definition
Parameters
- name
- The name of the dataset.
Type Parameters
- T
- The type of dataset definition.
Public Function GetDefinition(Of T As Definition)( _ ByVal name As String _ ) As T
public T GetDefinition<T>( string name ) where T: Definition
| Exception | Description |
|---|---|
| System.InvalidOperationException | No valid data store has been opened prior to calling this operation. -or- The DatasetType corresponding to type T is not supported. |
| System.ArgumentException | name is null or an empty string. |
| ArcGIS.Core.Data.Exceptions.GeodatabaseCatalogDatasetException | name does not exist or cannot be opened in the data store. |
| ArcGIS.Core.Data.Exceptions.GeodatabaseException | A geodatabase-related exception has occurred. |
{
//Note: This snippet requires to be run on the MCT (Main CIM Thread)
string path = @"d:\Data\Tin";
var fileConnection = new FileSystemConnectionPath(new Uri(path), FileSystemDatastoreType.Tin);
using (FileSystemDatastore dataStore = new FileSystemDatastore(fileConnection))
{
// TIN is in a folder at d:\Data\Tin\TinDataset
string dsName = "TinDataset";
using (var def = dataStore.GetDefinition<ArcGIS.Core.Data.Analyst3D.TinDatasetDefinition>(dsName))
{
//Do something with the definition
}
}
}
{
//Note: Use QueuedTask.Run to run on the MCT
string path = @"d:\Data\LASDataset";
var fileConnection = new FileSystemConnectionPath(new Uri(path), FileSystemDatastoreType.LasDataset);
using (FileSystemDatastore dataStore = new FileSystemDatastore(fileConnection))
{
string name = "utrecht_tile.lasd"; // can specify with or without the .lasd extension
using (var dataset = dataStore.GetDefinition<ArcGIS.Core.Data.Analyst3D.LasDatasetDefinition>(name))
{
//Use the dataset
}
}
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)