Please see the simple EE code below, which basically displays 2 different layers of information, selected and masked from the GLAD alerts image collection.

var all_alerts  = ee.ImageCollection('projects/glad/alert/UpdResult');
var country     = ee.FeatureCollection('USDOS/LSIB_SIMPLE/2017').filter(ee.Filter.eq('country_co', 'CG'));
var alerts_2021 = all_alerts.select('alertDate21','conf21').mosaic().clip(country);
var alertMasked = alerts_2021.mask(alerts_2021.gt(0));
var viz = {palette: ['FFFF00', '00FF00']};

Map.centerObject(country, 9);
Map.addLayer(alertMasked.select('alertDate21'), viz, 'alertDOY', true);

var alerts_conf = all_alerts.select('conf21').mosaic().clip(country);
var alertMasked2 = alerts_conf.mask(alerts_conf.gt(0));
Map.addLayer(alertMasked2, {palette:['red']}, 'alert',true);

Despite the layers are masked based on different data, their spatial extent should be the same. However, at small scale alertDOY (the yellow-green palette one) looks much larger than alert (the red one). This is evident if one toggles on-off the layers). But after zooming in, it is clear that the 2 layers coincide. How can this been fixed/explained?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.