How to add color map to image service

220
0
12-23-2020 10:08 AM
FranklinAlexander
Occasional Contributor II

I have an image service created from a mosaic dataset with a pixel type of float and 32 bit depth. Evidently it isn't possible to add a color map function (I tried) to a raster that has greater than 16bit pixel depth, so I am trying to render the color map to the image service from the javascript (client side). I have tried the following script, but it's not working. I can see the image, but it shows on the map as black to white stretch. 

 

 

let remapRF = new RasterFunction();
        remapRF.functionName = "remap";
        remapRF.functionArguments = {
            "InputRanges": [-0.072164394,0.040707171,0.040707171,0.118849024, 
                     0.118849024,0.223038161, 0.223038161,0.361957011, 
                     0.361957011,0.544288001, 0.544288001,0.752666275, 
                     0.752666275,1.026162761],
            "OutputValues": [1,2,3,4,5,6,7],
            "Raster": "$$"
        }
        remapRF.variableName = "biovolume";
        remapRF.outputPixelType = "F32";

let colorRF = new RasterFunction();
        colorRF.functionName = "Colormap";
        colorRF.variableName = "biovolume";
        colorRF.functionArguments = {
             "Colormap": [[1, 11,44,122], [2, 30,144,148], [3, 14,196,65], 
                   [4, 123,237,0], [5, 247,215,7], [6, 230,142,28], 
                   [7, 194,82,60]],
            "Raster": remapRF
        };

 

 

0 Replies