This sample shows how to implement a custom raster type from the ground up to provide support for DMCII data. Also provided is an optional test application to create a geodatabase and a mosaic dataset, and add data using the custom type. The main interface to be implemented is the IRasterBuilder interface along with secondary interfaces such as IRasterBuilderInit (which provides access to the parent MD), IPersistVariant (which implements persistence), IRasterBuilderInit2 and IRasterBuilder2 (new interfaces added at 10.2).
The interface IRasterFactory also needs to be implemented for the raster type to show up in the list of raster types in the Add Rasters GP tool. The factory is responsible for creating the raster type object and setting some properties on it. It also enables the use of the aster product.
Language: C#, VB
Subject: Raster
Organization: Esri, http://www.esri.com
Date: 11/17/2017
ArcObjects SDK: 10.6
Visual Studio: 2015, 2017
.NET Target Framework: 4.5
- ArcObjects .NET API Reference online
- Sample Data Download
- What's new
- Download the ArcObjects SDK for .Net from MyEsri.com
- Start Visual Studio and open the solution.
- Build the DMCIIRasterType and TestDMCIIRasterType projects.
- The raster type can now be used like any of the built-in raster types in the system.
- Start ArcMap.
- Create a mosaic dataset.
- Run the Add Rasters To Mosaic Dataset tool.
- Select the mosaic dataset created as source.
- Select the DMCII Raster Type from the list of raster types.
- To adjust raster type specific properties, click the Raster Type Properties button to the right of the Raster Type Selection drop-down list. The Raster Type properties page opens with options to pick the specific product to add (All, L1R, or L1T) and the template to apply (Raw or Stretch).
- Change settings as desired and click OK.
- Use the directory picker, or drag and drop the directory containing the DMCII data into the table showing input workspaces.
- Click OK.
- The tool adds the DMCII data to the mosaic dataset using the custom raster type.
- Start Visual Studio and open the solution file.
- Open the TestDMCIIRasterType project.
- Edit the strings in the Setup MD Test Parameters region to specify the parameters that control what geodatabase to create, where to create the geodatabase and mosaic dataset, the names of the geodatabase and the mosaic dataset, what folder to add data from, and so on.
- Compile and run the program.
- The program console displays detailed messaging regarding the steps it performs and whether it has succeeded or not. It will also display any errors that occur.
- Load the created mosaic dataset into ArcMap or ArcCatalog.
Development licensing | Deployment licensing |
---|---|
ArcGIS Desktop Standard | ArcGIS Desktop Standard |
ArcGIS Desktop Advanced | ArcGIS Desktop Advanced |
Engine Developer Kit | Engine |