Select to view content in your preferred language

ImageryLayer interpolation with a renderer

411
1
Jump to solution
05-29-2023 06:46 AM
Nicolas_
New Contributor III

Hello,

My javascript map properly display an imageryLayer coming from an image server:

Nicolas__0-1685367547374.png

As you can see, the layer in displayed with bilinear interpoaltion as asked in my code:

 

 

let layerTMOY_QUOT = new ImageryLayer({
    url: URL_TMOY_QUOT,
    interpolation: "bilinear"
});
map.add(layerTMOY_QUOT);

 

 

Now if I add a renderer to the imagery layer, the dsplayed image is no longer interpolated:

Nicolas__2-1685367825053.png

 

You can see all the individual pixels. It seems that the interpolation properties is now ignored despite what I wrote in my code:

 

 

let layerTMOY_QUOT = new ImageryLayer({
    url: URL_TMOY_QUOT,
    renderer: rendererTemperature,
    interpolation: "bilinear",
});

 

 

How can I use both a renderer and interpolation of the displayed pixels?

 

EDIT: Here is the code for the renderer,in case it could be useful :

 

let rendererTemperature = new RasterStretchRenderer({
    statistics: [[-50, 40, 0, 0]],
    stretchType: "min-max",
    colorRamp: new MultipartColorRamp({
        colorRamps: [
            { algorithm: "cie-lab", fromColor: new Color([255, 0, 192, 255]), toColor: new Color([255, 128, 255, 255]) },
            { algorithm: "cie-lab", fromColor: new Color([255, 128, 255, 255]), toColor: new Color([208, 254, 254, 255]) },
            { algorithm: "cie-lab", fromColor: new Color([208, 254, 254, 255]), toColor: new Color([104, 127, 178, 255]) },
        ]
    })
});

 

0 Kudos
1 Solution

Accepted Solutions
Nicolas_
New Contributor III

Ok I found a solution. Forcing the format of the ImageryLayer to be "lerc" show the images as interpolated again:

let layerTMOY_QUOT = new ImageryLayer({
    url: URL_TMOY_QUOT,
    renderer: rendererTemperature,
    format: "lerc",
    interpolation: "bilinear"
});

View solution in original post

0 Kudos
1 Reply
Nicolas_
New Contributor III

Ok I found a solution. Forcing the format of the ImageryLayer to be "lerc" show the images as interpolated again:

let layerTMOY_QUOT = new ImageryLayer({
    url: URL_TMOY_QUOT,
    renderer: rendererTemperature,
    format: "lerc",
    interpolation: "bilinear"
});
0 Kudos