How to define Renderer for Raster accessed via dynamic Workspace

2520
3
Jump to solution
06-24-2016 01:37 PM
JoanneMcGraw
Occasional Contributor III

Using ArcGIS Server 10.4 and ESRI JSAPI 3.16, I am displaying a raster in the Map object using a dynamic "Raster" workspace (see: Trying to use ArcGISDynamicMapServiceLayer to display RasterDataSource). Now, I'm trying to display the top pixel value counts with, ultimately, user-specified colors but, for the purposes of illustration, let's just say the top 3 pixel value counts in red, green and blue, respectively.

If I had an ArcGISImageServiceLayer, I can use a RasterFunction to define a Colormap and setRenderingRule to use that RasterFunction. I've figured out how to do this but, alas, setRenderingRule isn't available for an ArcGISDynamicMapServiceLayer. Okay...

Then I tried to figure out if there's a way to do something similar with an ArcGISDynamicMapServiceLayer using the LayerDrawingOptions, setting its renderer to the RasterFunction and applying that to the ArcGISDynamicMapServiceLayer with the setLayerDrawingOptions method. No luck there.

I've looked at the Renderer classes and thought the UniqueValueRenderer might serve the purpose, but it requires a field that contains the "feature" attribute field that contains the data value. Obviously, I don't have a "feature" attribute table, but there is a raster attribute table associated with the TIFs being displayed but besides that, there's not symbology for a raster that I can use in this.

Can anyone suggest a combination of classes that might enable a client application to submit something like a color map to a raster displayed via a dynamic Raster workspace in an ArcGISDynamicMapServiceLayer?

As always, any suggestions that might point in a direction I haven't thought of yet are appreciated.

Cheers,

jtm

1 Solution

Accepted Solutions
JoanneMcGraw
Occasional Contributor III

Just an update... I struggled with this for quite a while; came back to it often. In the end, I decided it just wasn't possible. So, I bit the bullet and created image services for all the images I wanted to treat this way rather than trying to use dynamic access in some way. What I did do though, is created a single map service with an empty polygon feature class in it that I use to dynamically query all the raster attribute tables for these images. I get access to the image statistics (i.e., the count) and a bunch of other attributes I've added besides.

I guess I'll mark this as the "answer", but it's really a different solution to try to accomplish something.

View solution in original post

3 Replies
JoanneMcGraw
Occasional Contributor III

Alternatively, is there a way to point to my map service where the dynamic workspace is defined as an Image Service that will let me pass dynamicLayerInfos or something comparable? Perhaps I'll have better luck coming at it from that angle...

0 Kudos
JoanneMcGraw
Occasional Contributor III

Just an update... I struggled with this for quite a while; came back to it often. In the end, I decided it just wasn't possible. So, I bit the bullet and created image services for all the images I wanted to treat this way rather than trying to use dynamic access in some way. What I did do though, is created a single map service with an empty polygon feature class in it that I use to dynamically query all the raster attribute tables for these images. I get access to the image statistics (i.e., the count) and a bunch of other attributes I've added besides.

I guess I'll mark this as the "answer", but it's really a different solution to try to accomplish something.

StefanOffermann
Occasional Contributor II

Too bad this isn't possible...

Did you notice the differences in the REST API docs between 10.1 and 10.4? The topic "Export Map" of "Map Service", the note of "dynamicLayer" parameter.

10.1.1:

"If the layer source is a dataLayer based on a data table (table or queryTable dataSource), then set drawingInfo.
In case of dataLayer based on raster data source only transparency in the drawingInfo is supported. renderer is unsupported at 10.1."

Source: ArcGIS Server REST API 

10.4.1:

"If the layer source is a dataLayer based on a data table ( table or queryTable dataSource), then set drawingInfo."

Source: https://localhost:6443/arcgis/sdk/rest/index.html#/Export_Map/02ss00000062000000/ 

(is this available online?)