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:
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?
You or your client might be interested in GeoRover GRID. GRID is an add-in that works seamlessly with CADRG, CIB, and ECRG data regardless of folder structure.
https://leidos.widen.net/s/zhfbklvn7r/georover-grid-factsheet
Are you a software dev or do you work for Leidos?
Jeffrey,
Are these extensions you are trying to add recognized by ArcGIS Pro as rasters already? if so when you find the file extension you are looking for in the add-in you can just use the create layer API to create a raster layer directly then add the layer to a group layer and so on. I did not understand why you were looking at the mosaic dataset API unless I am missing something.
-Prashant
Greetings Prashant and Thank You for your reply.
ArcGIS Pro is able to read the CADRG, ECRG, and CIB, using Add Data Button and also through Geoprocessing , but I am trying to automate the process programmatically for my users. I don't have to create a Mosaic (maybe that is muddying up the waters for what I am trying to do here). I think you are telling me to just stick with the Raster Dataset API?
-Prashant, I am not able to read a Controlled Image Base dataset (*.i42 file extension) using the following:
GroupLayer groupLayer = LayerFactory.Instance.CreateGroupLayer(MyMap, 1, "CID_Layer");
RasterLayer rasterLayer = LayerFactory.Instance.CreateLayer(new Uri("//path to dataset" ), groupLayer) as RasterLayer;
The SDK raises "Failed to add data, unsupported data type." exception.
How does the SDK read CIB, CADRG, ECRG?
-Jeff
If you just create a layer without specifying a group layer does it work ?
No it doesn't.
I wanted to follow up with a work around since I could not do this the SDK. I had to build Pro toolbox/model that did the following:
Create a New file Geodatabase
Geodatabase feeds into Create Mosaic Dataset
Mosaic Dataset then feed into Add Rasters to Mosaic Dataset