Closed john-a-m closed 7 months ago
Sure thing. Here's a few examples:
Let me know if you have any more questions!
If anyone comes across this what is important to know is that if a geotiff has bands then pixelValuesToColorFn
will be given an array of values
rather than a singular value
. The population example highlights this well.
var layer = new GeoRasterLayer({
attribution: "European Commission: Global Human Settlement",
georaster: georaster,
opacity: 0.75,
resolution: 64,
pixelValuesToColorFn: function (values) {
var population = values[0];
if (population === -200) return;
if (population < 0) return;
return scale(population).hex();
}
});
I noticed when browsing through the issues that issue #67 seems to imply that it is possible to visualize a band by providing a
pixelValuesToColorFn
which sounds good to me. Is there an example of how to leveragepixelValuesToColorFn
to do this?