Raster image file source paths from mosaic dataset

202
1
12-01-2011 07:31 AM
NatarajuR1
New Contributor
Hi,
When images from different locations on disk are added to a mosaic dataset.
How to retrieve the file paths from the Mosaic dataset?

Iam able to get each RasterDataset by IRasterCatalogItem using IMosaicdataset Cataolog items.
Public IRasterDataset GetRasterCatalogItem(IRasterCatalog catalog, int oid)
{
    //OID is the ObjectID of the raster dataset in the raster catalog.
    IFeatureClass featureClass = (IFeatureClass)catalog;
    IRasterCatalogItem rasterCatalogItem = (IRasterCatalogItem)
        featureClass.GetFeature(oid);
    return rasterCatalogItem.RasterDataset;
}

Cheers in Advance
Nattu
0 Kudos
1 Reply
NatarajuR1
New Contributor
Below Code Snippet will give the Raster file Path and its associated files path too.

       IRasterDatasetInfo rasterDatasetInfo = (IRasterDatasetInfo)rasterDataset;

        for(int ind=0;ind<rasterDatasetInfo.FileList.Count;ind++)
        {
            string strName = rasterDatasetInfo.FileList.get_Element(ind);
            MessageBox.Show(strName);
        }
0 Kudos