Select to view content in your preferred language

How to set Image Sevice Layer Symbology

2801
2
01-13-2011 05:35 AM
by Anonymous User
Not applicable
Original User: a5xs

I am using a mosaic object to store time tagged images.  I discovered that if I create a mxd and publish to a dynamic map service my symbology changes do not get saved to the service and there is no way to get access to the values.  Therefore I switched to an image service in hopes that I would have access to the values.  In the arcmap gui I see I have access to the symbology properties but now I need access to them via code. 

Hooks I am looking for are:
1. Turn on alpha channel
2. Set alpha channel to band 4
3. Set the stretch type to none

[ATTACH]4257[/ATTACH]

[ATTACH]4256[/ATTACH]
0 Kudos
2 Replies
JimHenry
Emerging Contributor
Thanks to Laurence from ESRI support for help so far!

I am still in search of code hooks on the image service to turn on the alpha channel set it to band 4 and set the stretch type to none?

[ATTACH]4679[/ATTACH]

Good - I took the raw data and through code generated an image.
Better - Through a script take out the alpha channel.
Best - The original smoothed image.

[ATTACH]4681[/ATTACH]
[ATTACH]4680[/ATTACH]
0 Kudos
by Anonymous User
Not applicable
Original User: chri6255

Hi Jim,

Here is an example of the syntax you would you for a rendering rule performing a "Streach" raster funtion. There is a link below of different ways you can use the render rule to manipulate your image service.

RestLayerProperties();
imgLayer.BandIds = new int[] {0,1,2,3};
IDictionary<string, object> functionArguments = new Dictionary<string, object>();
functionArguments.Add("StretchType", iStretchType);
functionArguments.Add("NumberOfStandardDeviations", numberOfStandardDeviations);
functionArguments.Add("Statistics", statistics);
functionArguments.Add("Gamma", gamma);

imgLayer.RenderingRule = new RenderingRule() 
{ 
RasterFunctionName = "Stretch", 
RasterFunctionArguments = functionArguments, 
VariableName = "Raster" 
};
imgLayer.Refresh();


Here is a link to the documentation on what types of rendering rules you can use against your image service.
http://sampleserver3.arcgisonline.com/ArcGIS/SDK/REST/israsterfunctions.html
0 Kudos