Set Imagery Layer Options Activity
Hello,
I would like to use the Set Imagery Layer Options Activity to implement a raster filter to be used with GVH.
Could you possibly supply a a sample workflow that uses the Set Imagery Layer Options Activity?
I would like to implement the following ESRI JavaScript API Sample
https://developers.arcgis.com/javascript/3/jssamples/layers_raster.html
as a test case (without the slider at first, just by hard coding a temperature range).
Thank you,
Helen
-
Hello Helen,
I will look into creating a sample workflow for this activity.
We have an existing sample for our version 4 Workflow technology that is included in the Workflows Sample Site, in the Common Client directory, named 'SetImageServiceInfo', which performs this function.
Thanks, Stefan
0 -
Hi Stefan,
A basic sample workflow that saves time on learning how to created the parameters using Workflow 5 activities that need to be passed to the Set Imagery Layer Options Activity would be very helpful.
Thanks,
Helen
0 -
Specifically, I am struggling with mapping the JavaScript data structures to Workflow 5 activities. What activity do I use to create a Function for the Raster Filter and Object for the Mosaic and Rendering Rules?
0 -
Hi Helen,
Unfortunately the example you have linked to is not possible in GVH. The pixel filter can be set on the layer but the layer does not store the pixel data which is necessary in order for the pixel filter function to work.
You can get similar behavior by setting a Raster Function on the layer, using the Set Imagery Layer Options activity.
You can read more about server-side rendering with raster functions here:
To use the Set Imagery Layer Options activity to set a rendering rule you can use the JSON representation of the rendering rule as the input.
You can find a good reference for the rendering rules here:
https://developers.arcgis.com/documentation/common-data-types/raster-function-objects.htm
Now for example if we wanted to set the Arithmetic raster function from the link above on an imagery layer we could supply the following code to the rendering rule input:
={ "rasterFunction" : "Arithmetic", "rasterFunctionArguments" : { { "Raster" : "$$", "Raster2: "100", "Operation" : 2 } }This will set the layer's rendering rule and the server will then use that when rendering the image that will be returned.
Using a combination of available rendering rules the behavior in the sample you provided should be possible.
The same steps can be followed to add a Mosaic rule, except of course passing a Mosaic rule object instead of a Raster function object.
To answer your second question, to use JavaScript data structures in workflows there are a few approaches you can take.
To create a function you could put something like this in an input:
=function(parameter){ console.log(parameter); }Of course this is great if you need a really small function but for more complex functions we recommend creating a custom activity that returns the function you want to use.
You can read more about custom activities here:
Thanks,
Braiden
1 -
Thanks for this example.
0
Bitte melden Sie sich an, um einen Kommentar zu hinterlassen.
Kommentare
5 Kommentare