Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

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!

share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.