Loading CADRG, EDRG, CIB Rasters

764
8
10-05-2023 11:08 AM
Jeffrey_McNeal
New Contributor

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? 

0 Kudos
8 Replies
StevenCorpus
New Contributor

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

https://www.leidos.com/products/georover

0 Kudos
Jeffrey_McNeal
New Contributor

Are you a software dev or do you work for Leidos?

0 Kudos
Prashant_MukeshMangtani
Esri Contributor

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

0 Kudos
Jeffrey_McNeal
New Contributor

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?

 

 

0 Kudos
Jeffrey_McNeal
New Contributor

-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

 

 

0 Kudos
Prashant_MukeshMangtani
Esri Contributor

If you just create a layer without specifying a group layer does it work ?

0 Kudos
Jeffrey_McNeal
New Contributor

No it doesn't.

0 Kudos
Jeffrey_McNeal
New Contributor

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

0 Kudos