Skip to content

Commit

Permalink
Merge pull request #2394 from eurodatacube/amazon-maps
Browse files Browse the repository at this point in the history
chore: reimplement RECCAP2 Amazon Data Cube for non-stac access
  • Loading branch information
lubojr authored Nov 17, 2023
2 parents f3a6440 + 25123f5 commit f2e7d4a
Show file tree
Hide file tree
Showing 41 changed files with 256 additions and 7 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 11 additions & 0 deletions app/public/eodash-data/stories/RECCAP/RECCAP2_1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Aboveground carbon

Aboveground carbon [MgC/ha] (2011-2019) derived from different L-VOD indices calibrated to AGC using the ESA CCI biomass map. Provides data based on different filtering methods (smoothed, max and trend) as well as their mean.

Source:

SMOS-IC passive microwave satellite images L-VOD product (version 2.0), Wigneron, J.-P., Li, X., Frappart F., Fan L., Al-Yaari A., De Lannoy G., Liu X., Wang M., Le Masson E., Moisy C. (2021). SMOS-IC data record of soil moisture and L-VOD: historical development, applications and perspectives, Remote Sens. Env., 254, 112238, https://doi.org/10.1016/j.rse.2020.112238,

Fawcett, Dominic, Sitch, Stephen, Ciais, Philippe, Wigneron, Jean Pierre, Silva-Junior, Celso H. L., Heinrich, Viola, Vancutsem, Christelle, Achard, Frédéric, Bastos, Ana, Yang, Hui, Li, Xiaojun, Albergel, Clément, Friedlingstein, Pierre, & Aragão, Luiz E. O. C. (2022). Processed Data for Figures of 'Declining Amazon biomass due to deforestation and subsequent degradation losses exceeding gains' (Version v1) [Data set]. Zenodo. https://doi.org/10.5281/zenodo.7245450

Units: MgC/ha
1 change: 1 addition & 0 deletions app/public/eodash-data/stories/RECCAP/RECCAP2_10.md
1 change: 1 addition & 0 deletions app/public/eodash-data/stories/RECCAP/RECCAP2_11.md
1 change: 1 addition & 0 deletions app/public/eodash-data/stories/RECCAP/RECCAP2_12.md
1 change: 1 addition & 0 deletions app/public/eodash-data/stories/RECCAP/RECCAP2_2.md
1 change: 1 addition & 0 deletions app/public/eodash-data/stories/RECCAP/RECCAP2_3.md
1 change: 1 addition & 0 deletions app/public/eodash-data/stories/RECCAP/RECCAP2_4.md
11 changes: 11 additions & 0 deletions app/public/eodash-data/stories/RECCAP/RECCAP2_5.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Secondary forest growth

Annual aboveground carbon gain due to regrowth of secondary forests [MgC/ha/yr] (2011-2018). Derived from growth function of Heinrich et al. Nature Communications (2021) and secondary forest maps of Silva Junior et al. Scientific Data (2020)

Source:

Silva Junior, C. H. L., Heinrich, V. H. A., Freire, A. T. G., Broggio, I. S., Rosan, T. M., Doblas, J., Anderson, L. O., Rousseau, G. X., Shimabukuro, Y. E., Silva, C. A., House, J. I., & Aragão, L. E. O. C. (2020). Benchmark maps of 33 years of secondary forest age for Brazil. Scientific Data, 7. https://doi.org/10.5281/zenodo.3928660,

Fawcett, Dominic, Sitch, Stephen, Ciais, Philippe, Wigneron, Jean Pierre, Silva-Junior, Celso H. L., Heinrich, Viola, Vancutsem, Christelle, Achard, Frédéric, Bastos, Ana, Yang, Hui, Li, Xiaojun, Albergel, Clément, Friedlingstein, Pierre, & Aragão, Luiz E. O. C. (2022). Processed Data for Figures of 'Declining Amazon biomass due to deforestation and subsequent degradation losses exceeding gains' (Version v1) [Data set]. Zenodo. https://doi.org/10.5281/zenodo.7245450

Units: MgC/ha/year
9 changes: 9 additions & 0 deletions app/public/eodash-data/stories/RECCAP/RECCAP2_6.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Deforested Biomass

Annual aboveground carbon loss due to forest cover change [MgC/ha/yr] (2011-2018). Derived from Mapbiomas Amazonia Collection 2 (Landsat) data.

Source:

MapBiomas. (2021). Project MapBiomas—Collection 2 of Brazilian land cover and use map. https://mapbiomas.org/, Fawcett, Dominic, Sitch, Stephen, Ciais, Philippe, Wigneron, Jean Pierre, Silva-Junior, Celso H. L., Heinrich, Viola, Vancutsem, Christelle, Achard, Frédéric, Bastos, Ana, Yang, Hui, Li, Xiaojun, Albergel, Clément, Friedlingstein, Pierre, & Aragão, Luiz E. O. C. (2022). Processed Data for Figures of 'Declining Amazon biomass due to deforestation and subsequent degradation losses exceeding gains' (Version v1) [Data set]. Zenodo. https://doi.org/10.5281/zenodo.7245450

Units: MgC/ha/year
12 changes: 12 additions & 0 deletions app/public/eodash-data/stories/RECCAP/RECCAP2_7.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Degraded Biomass

Annual aboveground carbon loss due to forest degradation, including fires but excluding edge effects [Mg C ha yr] (2011-2018). Derived from the JRC tropical moist forest maps (Landsat) of Vancutsem et al. Science Advances (2021)


Source:

Vancutsem, C., Achard, F., Pekel, J.-F., Vieilledent, G., Carboni, S., Simonetti, D., Gallego, J., Aragão, L. E. O. C., & Nasi, R. (2021). Long-term (1990–2019) monitoring of forest cover changes in the humid tropics. Science Advances, 7(10), eabe1603. https://doi.org/10.1126/sciadv.abe1603,

Fawcett, Dominic, Sitch, Stephen, Ciais, Philippe, Wigneron, Jean Pierre, Silva-Junior, Celso H. L., Heinrich, Viola, Vancutsem, Christelle, Achard, Frédéric, Bastos, Ana, Yang, Hui, Li, Xiaojun, Albergel, Clément, Friedlingstein, Pierre, & Aragão, Luiz E. O. C. (2022). Processed Data for Figures of 'Declining Amazon biomass due to deforestation and subsequent degradation losses exceeding gains' (Version v1) [Data set]. Zenodo. https://doi.org/10.5281/zenodo.7245450

Units: MgC/ha/year
9 changes: 9 additions & 0 deletions app/public/eodash-data/stories/RECCAP/RECCAP2_8.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Edge biomass change

Annual aboveground carbon loss due to forest degradation within 120 m from forest edges [MgC/ha/yr] (2011-2018). Derived from loss function of Silva Junior et al. Science Advances (2020).

Source:

Fawcett, Dominic, Sitch, Stephen, Ciais, Philippe, Wigneron, Jean Pierre, Silva-Junior, Celso H. L., Heinrich, Viola, Vancutsem, Christelle, Achard, Frédéric, Bastos, Ana, Yang, Hui, Li, Xiaojun, Albergel, Clément, Friedlingstein, Pierre, & Aragão, Luiz E. O. C. (2022). Processed Data for Figures of "Declining Amazon biomass due to deforestation and subsequent degradation losses exceeding gains" (Version v1) [Data set]. Zenodo. https://doi.org/10.5281/zenodo.7245450

Units: MgC/ha/year
9 changes: 9 additions & 0 deletions app/public/eodash-data/stories/RECCAP/RECCAP2_9.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Intact biomass change

Annual aboveground carbon net change in old-growth forests excluding deforestation and degradation [MgC/ha/yr] (2011-2018). Derived from L-VOD AGC changes.

Source:

Fawcett, Dominic, Sitch, Stephen, Ciais, Philippe, Wigneron, Jean Pierre, Silva-Junior, Celso H. L., Heinrich, Viola, Vancutsem, Christelle, Achard, Frédéric, Bastos, Ana, Yang, Hui, Li, Xiaojun, Albergel, Clément, Friedlingstein, Pierre, & Aragão, Luiz E. O. C. (2022). Processed Data for Figures of "Declining Amazon biomass due to deforestation and subsequent degradation losses exceeding gains" (Version v1) [Data set]. Zenodo. https://doi.org/10.5281/zenodo.7245450

Units: MgC/ha/year
Binary file added app/public/legends/trilateral/RECCAP2_1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions app/public/legends/trilateral/RECCAP2_10.png
1 change: 1 addition & 0 deletions app/public/legends/trilateral/RECCAP2_11.png
1 change: 1 addition & 0 deletions app/public/legends/trilateral/RECCAP2_12.png
1 change: 1 addition & 0 deletions app/public/legends/trilateral/RECCAP2_2.png
1 change: 1 addition & 0 deletions app/public/legends/trilateral/RECCAP2_3.png
1 change: 1 addition & 0 deletions app/public/legends/trilateral/RECCAP2_4.png
Binary file added app/public/legends/trilateral/RECCAP2_5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/legends/trilateral/RECCAP2_6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/legends/trilateral/RECCAP2_7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/legends/trilateral/RECCAP2_8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/public/legends/trilateral/RECCAP2_9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
22 changes: 22 additions & 0 deletions app/src/appConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,28 @@ module.exports = [
tutorialText: '/data/trilateral/tutorials',
challengesText: '/eodash-data/general/eodashboardhackathon',
showNewsCarousel: true,
demoMode: {
cop28: [
{
poi: 'World-RECCAP2_1',
},
{
poi: 'World-RECCAP2_5',
},
{
poi: 'World-RECCAP2_6',
},
{
poi: 'World-RECCAP2_7',
},
{
poi: 'World-RECCAP2_8',
},
{
poi: 'World-RECCAP2_9',
},
],
},
newsCarouselitems: [
{
poi: 'Onset-ADD',
Expand Down
4 changes: 2 additions & 2 deletions app/src/components/IndicatorData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ export default {
dataLayerTimeFromMap: null,
compareLayerTimeFromMap: null,
lineChartIndicators: [
'E12', 'E12b', 'E8', 'N1b', 'N1', 'NASACustomLineChart', 'N3', 'N3b', 'SST',
'E12', 'E12b', 'E8', 'N1b', 'N1', 'NASACustomLineChart', 'XCubeCustomLineChart', 'N3', 'N3b', 'SST',
'GG', 'E10a', 'E10a9', 'CV', 'OW', 'E10c', 'E10a10', 'OX',
'N1a', 'N1c', 'N1d', 'N9', 'LWE', 'LWL',
'E13o', 'E13p', 'E13q', 'E13r', 'CDS1', 'CDS2', 'CDS3', 'CDS4',
Expand Down Expand Up @@ -973,7 +973,7 @@ export default {
clipMap: 'items',
});
} else if (['AQA', 'AQB', 'AQC', 'MOBI1', 'AQ3', 'REP4_1',
'REP4_4', 'REP4_6', 'ADO'].includes(indicatorCode)) {
'REP4_4', 'REP4_6', 'ADO', 'XCubeCustomLineChart'].includes(indicatorCode)) {
// Rendering for fetched data
// TODO: there are quite some dependencies on the expected structure of the data, so
// it is not possible to show easily multiple parameters
Expand Down
8 changes: 4 additions & 4 deletions app/src/components/map/layers.js
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,8 @@ export function createLayerFromConfig(config, map, _options = {}) {
// gets the current time entry from the store
source = new XYZSource({
attributions: config.attribution,
maxZoom: config.maxZoom,
minZoom: config.minZoom,
maxZoom: config.maxNativeZoom || config.maxZoom,
minZoom: config.minNativeZoom || config.minZoom,
crossOrigin: typeof config.crossOrigin !== 'undefined' ? config.crossOrigin : 'anonymous',
transition: 0,
projection: getProjectionOl(config.projection),
Expand All @@ -455,8 +455,8 @@ export function createLayerFromConfig(config, map, _options = {}) {
} else {
source = new XYZSource({
attributions: config.attribution,
maxZoom: config.maxZoom,
minZoom: config.minZoom,
maxZoom: config.maxNativeZoom || config.maxZoom,
minZoom: config.minNativeZoom || config.minZoom,
crossOrigin: typeof config.crossOrigin !== 'undefined' ? config.crossOrigin : 'anonymous',
projection: getProjectionOl(config.projection),
transition: 0,
Expand Down
105 changes: 105 additions & 0 deletions app/src/config/trilateral.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import {
evalScriptsDefinitions,
parseStatAPIResponse,
nasaStatisticsConfig,
xcubeAnalyticsConfig,
} from '@/helpers/customAreaObjects';

const wkt = new Wkt();
Expand Down Expand Up @@ -576,6 +577,54 @@ export const indicatorsDefinition = Object.freeze({
},
],
},
RECCAP2_1: {
themes: ['biomass'],
story: '/eodash-data/stories/RECCAP/RECCAP2_1',
},
RECCAP2_2: {
themes: ['biomass'],
story: '/eodash-data/stories/RECCAP/RECCAP2_1',
},
RECCAP2_3: {
themes: ['biomass'],
story: '/eodash-data/stories/RECCAP/RECCAP2_1',
},
RECCAP2_4: {
themes: ['biomass'],
story: '/eodash-data/stories/RECCAP/RECCAP2_1',
},
RECCAP2_5: {
themes: ['biomass'],
story: '/eodash-data/stories/RECCAP/RECCAP2_5',
},
RECCAP2_6: {
themes: ['biomass'],
story: '/eodash-data/stories/RECCAP/RECCAP2_6',
},
RECCAP2_7: {
themes: ['biomass'],
story: '/eodash-data/stories/RECCAP/RECCAP2_7',
},
RECCAP2_8: {
themes: ['biomass'],
story: '/eodash-data/stories/RECCAP/RECCAP2_8',
},
RECCAP2_9: {
themes: ['biomass'],
story: '/eodash-data/stories/RECCAP/RECCAP2_9',
},
RECCAP2_10: {
themes: ['biomass'],
story: '/eodash-data/stories/RECCAP/RECCAP2_9',
},
RECCAP2_11: {
themes: ['biomass'],
story: '/eodash-data/stories/RECCAP/RECCAP2_9',
},
RECCAP2_12: {
themes: ['biomass'],
story: '/eodash-data/stories/RECCAP/RECCAP2_9',
},
PRCTS: {
indicatorSummary: 'Precipitation anomaly',
themes: ['agriculture'],
Expand Down Expand Up @@ -995,7 +1044,63 @@ const getWeeklyDates = (start, end) => {
return dateArray;
};

const createRECCAP2Config = (indicatorCode, name, variable, vmin, vmax, cbar, time, yAxis) => ({
properties: {
indicatorObject: {
indicator: indicatorCode,
dataLoadFinished: true,
country: 'all',
city: 'World',
siteName: 'global',
description: '',
indicatorName: name,
subAoi: {
type: 'FeatureCollection',
features: [],
},
aoiID: 'World',
time,
inputData: [''],
yAxis,
display: {
presetView: {
type: 'FeatureCollection',
features: [{
type: 'Feature',
properties: {},
geometry: wkt.read('POLYGON((-82.46 13.76,-33.24 13.76,-33.24 -22.58,-82.46 -22.58,-82.46 13.76))').toJson(),
}],
},
legendUrl: `legends/trilateral/${indicatorCode}.png`,
protocol: 'xyz',
tileSize: 256,
minZoom: 1,
url: `https://reccap2.api.dev.brockmann-consult.de/api/tiles/cop28~reccap2-9x108x139-0.0.1.zarr/${variable}/{z}/{y}/{x}?crs=EPSG:3857&time={time}&vmin=${vmin}&vmax=${vmax}&cbar=${cbar}`,
name,
dateFormatFunction: (date) => `${date}`,
labelFormatFunction: (date) => date,
minNativeZoom: 3,
maxNativeZoom: 5,
customAreaIndicator: true,
areaIndicator: xcubeAnalyticsConfig({ href: `https://reccap2.api.dev.brockmann-consult.de/api/timeseries/cop28~reccap2-9x108x139-0.0.1.zarr/${variable}?aggMethods=median` }),
},
},
},
});

export const globalIndicators = [
createRECCAP2Config('RECCAP2_1', 'Methods mean aboveground carbon (CCI RECCAP2)', 'AGC_LVOD_amazonia_methods_mean_crop', 0, 150, 'rain', getYearlyDates('2011-01-01', '2019-01-01'), 'Mg C/ha'),
createRECCAP2Config('RECCAP2_2', 'Smooth max aboveground carbon (CCI RECCAP2)', 'AGC_LVOD_amazonia_smooth_max_crop', 0, 150, 'rain', getYearlyDates('2011-01-01', '2019-01-01'), 'Mg C/ha'),
createRECCAP2Config('RECCAP2_3', 'Smooth mean aboveground carbon (CCI RECCAP2)', 'AGC_LVOD_amazonia_smooth_mean_crop', 0, 150, 'rain', getYearlyDates('2011-01-01', '2019-01-01'), 'Mg C/ha'),
createRECCAP2Config('RECCAP2_4', 'Trend mean aboveground carbon (CCI RECCAP2)', 'AGC_LVOD_amazonia_trend_mean_crop', 0, 150, 'rain', getYearlyDates('2011-01-01', '2019-01-01'), 'Mg C/ha'),
createRECCAP2Config('RECCAP2_5', 'Secondary forest growth (CCI RECCAP2)', 'SF_biomass_growth', 0, 2, 'YlGn', getYearlyDates('2011-01-01', '2018-01-01'), 'Mg C/ha/year'),
createRECCAP2Config('RECCAP2_6', 'Deforestation (CCI RECCAP2)', 'deforested_biomass', 0, 5, 'YlOrRd', getYearlyDates('2011-01-01', '2018-01-01'), 'Mg C/ha/year'),
createRECCAP2Config('RECCAP2_7', 'Degradation (CCI RECCAP2)', 'degraded_biomass', 0, 5, 'YlOrRd', getYearlyDates('2011-01-01', '2018-01-01'), 'Mg C/ha/year'),
createRECCAP2Config('RECCAP2_8', 'Edge biomass change (CCI RECCAP2)', 'edge_biomass_change', 0, 5, 'YlOrRd', getYearlyDates('2011-01-01', '2018-01-01'), 'Mg C/ha/year'),
createRECCAP2Config('RECCAP2_9', 'Methods mean intact biomass change (CCI RECCAP2)', 'intact_biomass_change_methods_mean', -5, 5, 'Spectral', getYearlyDates('2011-01-01', '2018-01-01'), 'Mg C/ha/year'),
createRECCAP2Config('RECCAP2_10', 'Smooth max intact biomass change (CCI RECCAP2)', 'intact_biomass_change_smooth_max', -5, 5, 'Spectral', getYearlyDates('2011-01-01', '2018-01-01'), 'Mg C/ha/year'),
createRECCAP2Config('RECCAP2_11', 'Smooth mean intact biomass change (CCI RECCAP2)', 'intact_biomass_change_smooth_mean', -5, 5, 'Spectral', getYearlyDates('2011-01-01', '2018-01-01'), 'Mg C/ha/year'),
createRECCAP2Config('RECCAP2_12', 'Mean intact biomass change trend (CCI RECCAP2)', 'intact_biomass_change_trend_mean', -5, 5, 'Spectral', getYearlyDates('2011-01-01', '2018-01-01'), 'Mg C/ha/year'),
{
properties: {
indicatorObject: {
Expand Down
45 changes: 44 additions & 1 deletion app/src/helpers/customAreaObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ export const fetchCustomAreaObjects = async (
requestBody[params[i]] = template(templateRe, requestBody[params[i]], templateSubst);
}
// Convert geojsons back to an object
if (params[i] === 'geojson') {
if (['geojson', 'coordinates'].includes(params[i])) {
requestBody[params[i]] = JSON.parse(requestBody[params[i]]);
}
}
Expand Down Expand Up @@ -553,6 +553,49 @@ export const nasaTimelapseConfig = (
),
});

export const xcubeAnalyticsConfig = (
exampleEndpoint,
indicatorCode = 'XCubeCustomLineChart',
) => ({
url: exampleEndpoint.href,
requestMethod: 'POST',
requestHeaders: {
'Content-Type': 'application/json',
},
requestBody: {
type: 'Polygon',
coordinates: '{coordinates}',
},
callbackFunction: (responseJson, indicator) => {
let ind = null;
if (Array.isArray(responseJson.result)) {
const data = responseJson.result;
const newData = {
time: [],
measurement: [],
};
data.forEach((row) => {
newData.time.push(DateTime.fromISO(row.time));
newData.measurement.push(row.median);
});
if (indicatorCode) {
// if we for some reason need to change indicator code of custom chart data
newData.indicator = indicatorCode;
}
ind = {
...indicator,
...newData,
};
}
return ind;
},
areaFormatFunction: (area) => (
{
coordinates: JSON.stringify(area.coordinates),
}
),
});

export const nasaStatisticsConfig = (
rescale = (value) => value / 1e14,
indicatorCode = 'NASACustomLineChart',
Expand Down

0 comments on commit f2e7d4a

Please sign in to comment.