Select to view content in your preferred language

How to assign a classified renderer to a GdbRasterCatalog layer

486
2
05-19-2011 06:26 AM
ThomasCox
Frequent Contributor
I am trying to assign a classified renderer to a GdbRasterCatalog  layer with no luck.  I have examined the samples that are provided, but have not been able to make it behave.

I have developed code that allows a user to specify a date range, retrieve GRIDS falling within the range, build, and populate a GdbRasterCatalog, and add it to the ArcMap session.  I was hoping the classification renderer assignment would be as straight forward as it is with a standard stand alone raster.

For the portion of the application that retrieves the stand alone GRIDS, it is pretty straight forward to assign an existing renderer derived from a .lyr file that contains the proper renderer classification definition. The GdbRasterCatalog apparently does not offer the option of  assigning a renderer in that fashion. 

Through the ArcMap interface, I am able to go through the process of adding the classified renderer type and removing the other non needed rendering types and building the appropriate classified renderer.  I need to be able to do this programmatically through C#.  I understand that the classification renderer is not one of the ???default??? renderers associated with the GDBRasterCatalog layer.

I have examined the IRasterCatalogRendererPicker bit, with no luck.

If need be, I can go through the effort of building the classified renderer directly from the catalog and abandon trying to use the renderer derived from the .lyr file. However, I still need to know how to assign the renderer to the GdbCatalog layer.

Any assistance would be greatly appreciated
0 Kudos
2 Replies
NeilClemmons
Honored Contributor
Can you not use IGeoFeatureLayer.Renderer to assign the renderer from the layer file to the layer?
0 Kudos
ThomasCox
Frequent Contributor
Thanks for the response. 

I have not tried your suggestion.  However, as soon as I finished the post, it occurred to me to build a new array, load it with the desired renderer from the layer file and then assign the renderers property fo the GdbRasterCatalog layer to the array.

                IArray pArray = new ESRI.ArcGIS.esriSystem.Array();
                pArray.Add(pRasterClassify);
                pGdbRasterCatalogLayer.Renderers = pArray;

I appreciate your response. As I refine the the application I may migrate to the approach you suggested.
0 Kudos