Using ArcGIS Pro SDK 3.1
I am building an Add On for a user that wants to have the capability of loading a single directory that contains multiple Raster types (CADRG, CIB, ECRG, etc) that are located in its own subdirectory. Each Raster package would go on its own layer. I had a working version in ArcGIS Runtime .NET that had the following flow:
- Create a new GroupLayer
- Recursively searched a given directory structure searching for *.i42, *.onl, *.i22, and *.tl2 files
- When the above file type is found, create a new Raster with the file
- Add the Raster to a RasterLayer
- When finished with current directory, add the RasterLayer to the GroupLayer
- When finished with a given Raster directory, add the GroupLayer to a list of GroupLayers
- When finished with all directories, Add all the GroupLayers to the Map
- Set the MapView with Map, then load the MapView
- Set the ViewpointGeometry
In ArcGIS Pro SDK, I found this to open Mosaic DataSets:
// Create a FileSystemConnectionPath using the path to the folder.
FileSystemConnectionPath connectionPath =
new FileSystemConnectionPath(new System.Uri(@"c:\test"), FileSystemDatastoreType.Raster);
// Create a new FileSystemDatastore using the FileSystemConnectionPath.
FileSystemDatastore dataStore = new FileSystemDatastore(connectionPath);
// Open the Mosaic dataset.
MosaicDataset mosaicDatasetToOpen = dataStore.OpenDataset<MosaicDataset>("testmosaicdataset.amd");
This does not appear to span multiple directories if the given Raster has > 1 directory. Also, it appears that SDK needs to know the filetype at runtime.
What is the proper way to load these types of raster datasets?