Tuesday, 20 December 2016

arcgis 10.0 - Modify raster layer display and symbology properties programmatically with arcpy or ArcObjects


I have over 1500 NITF files that I need to be able to modify the layer display and symbology of programmatically from within ArcMap. I need to set the properties outlined in red below:


enter image description here enter image description here


I've looked through the arcpy docs and it doesn't look like these properties are exposed - honestly, I didn't expect them to be. I have a feeling I can get to them through ArcObjects. Anyone had any experience/luck modifying these properties programmatically?



Answer



I believe stretched raster symbology is rendered via RasterStretchColorRampRenderer, so interfaces implemented by this class are a good start. The renderer is assigned to your raster layer through IRasterLayer.Renderer.



  1. Stretch type: IRasterStretch.StretchType

  2. High/low stretch values: IRasterStretchMinMax



Orthorectification is controlled by a different set of interfaces, pertaining to the raster data source itself. IRaster2.GeodataXform can point to a geodata transformation class implementing ISensorXform which contains the orthorectification properties you see in the layer's property page.


No comments:

Post a Comment

arcpy - Changing output name when exporting data driven pages to JPG?

Is there a way to save the output JPG, changing the output file name to the page name, instead of page number? I mean changing the script fo...