3

I would like to programmatically export symbology for a raster dataset as a raster function template xml file, as can be done by clicking the export button in the symbology tab of the layer properties dialog in ArcMap 10.2.2.

I wish to do this in a batch environment (outside of ArcMap) using ArcObjects.


Subsequently ESRI Canada support advised that the export required above is not exposed in the ArcObjects API. However I have found that xml serializing the RasterRenderer for the layer, snippet here, does in fact produce the same content as seen as the value for the Renderer variable in the manually / UI exported raster function template (!).

I'm trying to bring the symbology across for individual rasters after they are added to a mosaic dataset. Color maps seem to come across, but stretches don't. So after realizing the above, I'm working on wrapping the RasterRender serialized XML to be a raster function template and then applying it.

  • There is sample code in the Help file (TestNDVICustomFunction) that uses the IXMLSerialize interface to serialize it into XML. What I could not work out from the code sample was how one got an IRasterFunctionTemplate object from an existing raster created from a series of raster functions. – Hornbydd Jan 8 '15 at 10:54
  • @Hornbydd that looks like enough to post as an answer. – PolyGeo Jun 3 '17 at 11:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.