Create a raster catalog in a file geodatabase

This sample demonstrates how to use ArcObjects Java to create a raster catalog in a file geodatabase and how to load rasters from a directory into the raster catalog.
The file geodatabase is called CreateFGDBRasterCatalog.gdb. The raster workspace is called inputRasterWorkspace and contains two rasters and their auxiliary files. This sample application locates these datasets at run time.

How to use

See How to use ArcGIS samples for help on running the sample.

Data has been provided for your use with this sample. It can be found at <Your ArcGIS Developer Kit Install directory>/Samples/data/$AGSDEVKITJAVA/java/samples/data/raster.

Conceptual workflow
  1. Create a file geodatabase in the output folder.
  2. Create a raster catalog and load the datasets from the input raster workspace folder into the raster catalog. A reference to a raster workspace is obtained from a raster workspace factory object by creating an instance of the raster workspace factory, then calling the OpenFromFile method on the factory to get the raster workspace.
  3. Since the catalog is stored in the file geodatabase, obtain an object from the file geodatabase workspace factory and get the empty raster workspace from it. In this sample, there are two datasets in the geodatabase. Get a reference to it from the collection of dataset objects, which are held in the IEnumDataset interface.
  4. Prepare the catalog for inserts by creating a feature cursor.
  5. Iterate through the collection of rasters and load each one into the raster catalog.

At run time
  1. Run the application. This application creates a file geodatabase and a raster catalog inside the file geodatabase. The raster datasets are loaded into the raster catalog from a folder.

If you installed the samples feature, you will find the files associated with this sample in <Your Developer Kit install location>\DeveloperKit10.4\Java\Samples\ArcObjects.

raster/ Main class

Development licensing Deployment licensing
Engine Developer Kit Engine
ArcGIS for Desktop Basic
ArcGIS for Desktop Standard
ArcGIS for Desktop Advanced