LindaMcCafferty

Help with IRasterDomainExtractor for multi-band image

Discussion created by LindaMcCafferty on May 27, 2011
Hello -
I am using the IRasterDomainExtractor to create a polygon with the same extents as a raster layer. 

This code gives me a reference to the pRasterLayer (IRasterLayer) and from there creates the polygon.
pWorkspaceFactory = new SdeWorkspaceFactoryClass();
pRasterWorkspaceEx = pWorkspaceFactory.Open(pPropertySet, 0) as IRasterWorkspaceEx;
pRasterDataset = pRasterWorkspaceEx.OpenRasterDataset(< layer name >);
pRasterLayer = new RasterLayerClass();
pRasterLayer.CreateFromDataset(pRasterDataset);
IRasterDomainExtractor pRasDomExt = new RasterDomainExtractorClass();
IPolygon pPolygon = pRasDomExt.ExtractDomain(pRasterLayer.Raster, true);

This is working great as long as my raster layer is not a multi-band layer.

My question is when a multi-band layer is used, how can I get a reference to only one band so that I can create a polygon from that layer? 

If anyone has any suggestions, I would appreciate the help!

Thanks, Linda

Outcomes