From 23b04602e3aaf7d9f42785513de28d447e74e336 Mon Sep 17 00:00:00 2001 From: AngelArcones Date: Tue, 3 Dec 2024 18:37:58 +0100 Subject: [PATCH 1/3] create decoding function for DIST layer --- providers/datasets-provider/config.js | 45 +++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/providers/datasets-provider/config.js b/providers/datasets-provider/config.js index 1a4506b957..a3bff7c190 100644 --- a/providers/datasets-provider/config.js +++ b/providers/datasets-provider/config.js @@ -547,6 +547,50 @@ const decodes = { alpha = 0.; } `, + distAlerts: ` + // values for creating power scale, domain (input), and range (output) + float confidenceValue = 0.; + if (confirmedOnly > 0.) { + confidenceValue = 1.; + } + + float r = color.r * 255.; + float g = color.g * 255.; + float b = color.b * 255.; + + // **** CHECK THIS + // 1461 = days from 2019/01/01 to 2014/12/31 + // 1870 = days from 2020/02/14 to 2014/12/31 + float day = (r * 255.) + g; + + float confidence = floor(b / 100.); + if ( + day > 0. && + day >= startDayIndex && + day <= endDayIndex && + confidence >= confidenceValue + ) { + // get intensity + float intensity = mod(b, 100.) * 50.; + // float intensity = 255.; + if (intensity > 255.) { + intensity = 255.; + } + if (confidence < 2.) { + color.r = 238. / 255.; + color.g = 177. / 255.; + color.b = 177. / 255.; + alpha = intensity / 255.; + } else { + color.r = 137. / 255.; + color.g = 82. / 255.; + color.b = 119. / 255.; + alpha = intensity / 255.; + } + } else { + alpha = 0.; + } + `, RADDsCoverage: ` float red = color.r; float green = color.g; @@ -1058,6 +1102,7 @@ export default { GLADs: decodes.GLADs, RADDs: decodes.RADDs, RADDs2yearsTimeline: decodes.RADDs2yearsTimeline, + distAlerts: decodes.distAlerts, RADDsCoverage: decodes.RADDsCoverage, staticRemap: decodes.staticRemap, staticRemapAlpha: decodes.staticRemapAlpha, From d030becab006f48af1cb0bcc99dc4f81d401e746 Mon Sep 17 00:00:00 2001 From: AngelArcones Date: Wed, 4 Dec 2024 12:08:23 +0100 Subject: [PATCH 2/3] adjust alpha for filtered data --- providers/datasets-provider/config.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/providers/datasets-provider/config.js b/providers/datasets-provider/config.js index a3bff7c190..c18763f32d 100644 --- a/providers/datasets-provider/config.js +++ b/providers/datasets-provider/config.js @@ -568,7 +568,8 @@ const decodes = { day > 0. && day >= startDayIndex && day <= endDayIndex && - confidence >= confidenceValue + confidence >= confidenceValue && + alpha > 0. ) { // get intensity float intensity = mod(b, 100.) * 50.; From 34066b9694de9bcd278cfe00fc4cc0b04c361633 Mon Sep 17 00:00:00 2001 From: Luis Zenteno Date: Tue, 10 Dec 2024 16:23:15 -0600 Subject: [PATCH 3/3] feat(map-menu): update alert title --- components/map-menu/sections.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/map-menu/sections.js b/components/map-menu/sections.js index 6cf8d0aff3..45a7e7d357 100644 --- a/components/map-menu/sections.js +++ b/components/map-menu/sections.js @@ -107,7 +107,7 @@ export const datasetsSections = compact([ subCategories: [ { slug: 'deforestationAlerts', - title: 'Deforestation Alerts', + title: 'Disturbance Alerts', }, { slug: 'fireAlerts',