Create a raster catalog in a file geodatabase


Purpose
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/$ARCGISHOME/java/samples/data/raster.
If the sample has associated data, you will find that the sample's zip file includes a "data" folder alongside the language folders. However, you will need to update the sample to point to the location of the data once you have extracted all the files.

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.


Download the files for Java
raster/CreateFGDBRasterCatalog.java Main class




Development licensing Deployment licensing
Engine Developer Kit Engine Runtime
ArcView
ArcEditor
ArcInfo