From a7134734ed809176cfd3fb3ca1181a481497849c Mon Sep 17 00:00:00 2001 From: Daniel Santillan Date: Tue, 29 Oct 2024 11:34:37 +0100 Subject: [PATCH] chore: simplified regression description; added filtering for imperviosness; added both requested filtering datasets to HAUC1 --- app/src/components/IndicatorData.vue | 6 ++--- app/src/config/gtif.js | 33 +++++++++++++++++++++++++++- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/app/src/components/IndicatorData.vue b/app/src/components/IndicatorData.vue index ff5e86bf5e..d3094ec8a1 100644 --- a/app/src/components/IndicatorData.vue +++ b/app/src/components/IndicatorData.vue @@ -1570,8 +1570,8 @@ export default { parentDiv.id = 'regressionresult'; parentDiv.style.position = 'absolute'; parentDiv.style.top = '105px'; - parentDiv.style['margin-left'] = '80px'; - parentDiv.style['font-size'] = '11px'; + parentDiv.style['margin-left'] = '60px'; + parentDiv.style['font-size'] = '12px'; chart.data.datasets.forEach((val, idx) => { // currently we do not use sections so we assume sections with length 1 const { sections } = ChartRegressions.getDataset(chart, idx); @@ -1579,7 +1579,7 @@ export default { const { result } = sections[0]; const divEl = document.createElement('div'); divEl.style.color = `${this.appConfig.refColors[idx]}`; - const content = document.createTextNode(`R²: ${result.r2}; ${result.string}`); + const content = document.createTextNode(`R²: ${Number(result.r2).toFixed(3)}`); divEl.appendChild(content); parentDiv.appendChild(divEl); } diff --git a/app/src/config/gtif.js b/app/src/config/gtif.js index efee6bcdc9..763025faeb 100644 --- a/app/src/config/gtif.js +++ b/app/src/config/gtif.js @@ -1332,6 +1332,19 @@ export const globalIndicators = [ ['2023', '2023_LST_AT_merged_composite_mean_70m_3857.tif'], ['2024', '2024_LST_AT_merged_composite_mean_70m_3857.tif'], ], + cogFilters: { + sourceLayer: 'HAUC1', + filters: { + var: { + display: true, + label: 'Imperviosness [%]', + id: 'var', + min: 0, + max: 100, + range: [0, 100], + }, + }, + }, display: [ { protocol: 'cog', @@ -1339,13 +1352,31 @@ export const globalIndicators = [ id: 'HAUC1', sources: [ { url: 'https://eox-gtif-public.s3.eu-central-1.amazonaws.com/HeatAdapt/update/{time}' }, + { url: 'https://eox-gtif-public.s3.eu-central-1.amazonaws.com/HeatAdapt/update/IMD_2018_AT_70m_3857.tif' }, + { url: 'https://eox-gtif-public.s3.eu-central-1.amazonaws.com/HeatAdapt/update/LULUCF_2018_AT_70m_3857.tif' }, ], dateFormatFunction: (date) => `${date[1]}`, labelFormatFunction: (date) => date[0], style: { + variables: { + varMin: 0, + varMax: 100, + }, color: [ 'case', - ['!=', ['band', 2], 0], + [ + 'all', + ['!=', ['band', 4], 0], + ['between', + ['band', 2], + ['var', 'varMin'], + ['var', 'varMax'], + /* assuming a stretch from 0 to 255 but it seems to not be used + ['*', ['var', 'varMin'], 2.55], + ['*', ['var', 'varMax'], 2.55], + */ + ], + ], [ 'interpolate', ['linear'],