Geodatabase Constructor(FileGeodatabaseConnectionPath)
Opens a file geodatabase with the specified . This method must be called on the MCT. Use QueuedTask.Run.
Opening a File Geodatabase given the path
{
await QueuedTask.Run(() =>
{
// Opens a file geodatabase. This will open the geodatabase if the folder exists and contains a valid geodatabase.
using (Geodatabase geodatabase = new Geodatabase(new FileGeodatabaseConnectionPath(new Uri(@"C:\Data\LocalGovernment.gdb"))))
{
// Use the geodatabase.
}
});
}
Open raster dataset in a geodatabase
// Create a FileGeodatabaseConnectionPath using the path to the gdb. Note: This can be a path to a .sde file.
FileGeodatabaseConnectionPath geodatabaseConnectionPath = new(new Uri(@"C:\Temp\rasters.gdb"));
// Create a new Geodatabase object using the FileGeodatabaseConnectionPath.
Geodatabase geodatabase = new(geodatabaseConnectionPath);
// Open the raster dataset.
RasterDataset gdbRasterDataset = geodatabase.OpenDataset<RasterDataset>("sample");
Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)
ArcGIS Pro version: 3.0 or higher.