I have pretty much given up on trying to get help from ESRI forums so I thought I would try my luck with the good people here...
Here is what I have (in C#)... I have an IFeatureCursor that is giving me a selection from an IRasterCatalog (so basically it is a cursor full of IRasterCatalogItems). What I would like to do is take these rasters and mosaic them inside a method and return the mosaicked raster.
I have tried what I thought would be obvious beginning with an IRasterCollection...
IMosaicRaster m_mosaic = (IMosaicRaster)m_rasColl;
m_mosaic.WhereClause = "";
ISaveAs m_saveAS = (ISaveAs)m_mosaic;
IRasterDataset rasDataset =
(IRasterDataset)m_saveAS.SaveAs("tmp_" + selectedFeatureClass.FeatureClassID.ToString(),
tmpWS, "TIFF");
IRaster extractedRaster = rasDataset.CreateDefaultRaster();
// Compute the statistics for the raster.
IRasterCalcStatsHistogram m_calcStats = new RasterCalcStatsHistogramClass();
IStatsHistogram m_stHisto = new StatsHistogramClass();
m_calcStats.ComputeFromRaster(extractedRaster, 1, m_stHisto);
return extractedRaster;
This gave me what seemed to be a properly mosaicked raster, and the values seemed to be correct when I used the identify tool in ArcMap, however, the display looked like a raster that has not had statistics calculated and I can't seem to figure out why. So I started looking at less obvious ways to do it but I haven't had much luck so far.
Suggestions? Thanks a bunch!