I have a NVDI WMS layer configured to show NDVI index, and I need to let the user choose the color ramp.
Is there a way to send parameters from the client and get then inside the evaluatePixel function?
According to reference this is the signature of the method, but I can’t find an example that uses inputMetadata or customData or a reference about their content.
function evaluatePixel(samples, scene, inputMetadata, customData, outputMetadata) {
}
Thank you
As Grega said, the easiest way for user-defined color ramp is to generate the evalscript on the client side and pass it as a parameter.
There are also utility functions for evalscript that might come handy for defining the color ramp / color gradient in the evalscript (documentation here).
Use of inputMetadata, customData and outputMetadata is not necessary for this use-case, they are useful for more complex evalscript.