How to mosaic raster datasets to a raster dataset in a geodatabase

Mosaicking raster datasets to a raster dataset in a geodatabase

This article shows the best practice to mosaic multiple raster datasets into a raster dataset stored in ArcSDE or a file geodatabase using the geoprocessing mosaic tool class. You can change any options set in the following code example according to your requirements:
//    Use GP Mosaic tool clas to mosaic a list of input rasters to the target GDB(file GDB or ArcSDE) raster
Mosaic mosaic = new Mosaic();

//    Optional parameters, should be set according to data properties and mosaicking requirements
//    Modify or remove any statement as necessary

//    Set background value to be ignored

//    Set Nodata value

//    Set Mosaic Mode

//    Set Mosaic Colormap mode

//    Set Mosaic tolerance
GeoProcessor geoprocessor = new GeoProcessor();

//    Execute the tool to mosaic the input raster dataset to the target raster 
Object outRaster = geoprocessor.execute(mosaic, null);

Development licensingDeployment licensing
ArcGIS for Desktop BasicArcGIS for Desktop Basic
ArcGIS for Desktop StandardArcGIS for Desktop Standard
ArcGIS for Desktop AdvancedArcGIS for Desktop Advanced
Engine Developer KitEngine