GHS-BUILT-S2
//VERSION=3
function setup() {
return {
input: ["PROB", "dataMask"],
output: { bands: 3 , sampleType: "AUTO"},
mosaicking: Mosaicking.TILE
};
}
//Create color ramp
const ramps = [
[0, 0x000000],
[100, 0xffffff]
];
//Create visualizer
const visualizer = new ColorRampVisualizer(ramps);
//EvaluatePixel function
function evaluatePixel(samples, scenes) {
for (let i = 0; i < samples.length; i++) {
let sample = samples[i];
if (sample.dataMask == 1) {
return [visualizer.process(sample.PROB)[0], visualizer.process(sample.PROB)[1], visualizer.process(sample.PROB)[2]];
}
}
}
General description of the script
The Global Human Settlement Layer GHS-BUILT-S2 is a global map of built-up areas (expressed as probabilities from 0 to 100 %) at 10 m spatial resolution. It was derived from a Sentinel-2 global image composite for the reference year 2018 using Convolutional Neural Networks.
This script visualises the built-up probabilities stretched to 0-255.
Description of representative images
Global Human Settlement Layer built-up probabilities over parts of Germany, Netherlands and Belgium