Skip to content

Commit

Permalink
chore: add GHS data
Browse files Browse the repository at this point in the history
  • Loading branch information
lubojr committed Oct 25, 2023
1 parent a736974 commit ac017be
Show file tree
Hide file tree
Showing 11 changed files with 158 additions and 12 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.
3 changes: 3 additions & 0 deletions app/public/eodash-data/stories/GHSBUILT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
## GHS-BUILT-S-R2023A

Placeholder
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions app/public/legends/legends.json
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,13 @@
"label": "Sea Surface Temperature Anomaly [%]",
"ticks": [1,2,3,4,5],
"tickLabels": [-70,-38,0,33,70]
},
"GHS-BUILT-S_GLOBE_R2023A": {
"range": [1, 5],
"cm": [[1, [0,0,0,0]], [2, [124, 8, 169,255]], [3, [203, 71, 120,255]],[4, [246, 154, 67,255]],[5, [251, 250, 144]]],
"label": "GHS built-up surface",
"ticks": [1,2,3,4,5],
"tickLabels": [0,2500,5000,7500,10000]
}
},
"trilateral": {
Expand Down
5 changes: 3 additions & 2 deletions app/src/components/IndicatorData.vue
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ export default {
'N1a', 'N1c', 'N1d', 'N9', 'LWE', 'LWL',
'E13o', 'E13p', 'E13q', 'E13r', 'CDS1', 'CDS2', 'CDS3', 'CDS4',
'NPP', 'AQA', 'AQB', 'AQC', 'AQ3', 'REP4_1', 'REP4_4', 'REP4_6',
'MOBI1', 'PRCTS', 'SMCTS', 'VITS', 'E12c', 'E12d', 'ADO',
'MOBI1', 'PRCTS', 'SMCTS', 'VITS', 'E12c', 'E12d', 'ADO', 'GHSBUILT',
'Lakes_SWT',
// Year overlap comparison
'E13e', 'E13f', 'E13g', 'E13h', 'E13i', 'E13l', 'E13m',
Expand Down Expand Up @@ -414,6 +414,7 @@ export default {
referenceDecompose.CDS4 = referenceDecompose.N1;
referenceDecompose.NPP = referenceDecompose.N1;
referenceDecompose.Lakes_SWT = referenceDecompose.N1;
referenceDecompose.GHSBUILT = referenceDecompose.N1;
referenceDecompose.SMCTS = referenceDecompose.PRCTS;
referenceDecompose.VITS = referenceDecompose.PRCTS;
referenceDecompose.N3a2 = referenceDecompose.N1;
Expand Down Expand Up @@ -1673,7 +1674,7 @@ export default {
}
// Special handling for chart including STD representation
if (['N1', 'N3', 'E13o', 'E13p', 'E13q', 'E13r', 'CDS1', 'CDS2', 'CDS3', 'CDS4', 'N3a2', 'SST'].includes(indicatorCode)) {
if (['N1', 'N3', 'E13o', 'E13p', 'E13q', 'E13r', 'CDS1', 'CDS2', 'CDS3', 'CDS4', 'N3a2', 'SST', 'GHSBUILT'].includes(indicatorCode)) {
customSettings.legendExtend = {
onClick: function onClick(e, legendItem) {
if (legendItem.text === 'Standard deviation (STD)') {
Expand Down
67 changes: 57 additions & 10 deletions app/src/config/data_dates.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@
"2023-09-11",
"2023-09-18",
"2023-09-25",
"2023-10-02"
"2023-10-02",
"2023-10-09"
],
"AWS_ICEYE-E11": [
"2020-03-20"
Expand Down Expand Up @@ -2184,7 +2185,9 @@
"2023-09-02",
"2023-09-09",
"2023-09-16",
"2023-09-23"
"2023-09-23",
"2023-09-30",
"2023-10-07"
],
"AWS_N3_CUSTOM_TSMNN": [
"2019-01-05",
Expand Down Expand Up @@ -2429,7 +2432,9 @@
"2023-09-02",
"2023-09-09",
"2023-09-16",
"2023-09-23"
"2023-09-23",
"2023-09-30",
"2023-10-07"
],
"AWS_NO2-VISUALISATION": [
"2018-04-30",
Expand Down Expand Up @@ -2714,7 +2719,8 @@
"2023-09-04",
"2023-09-11",
"2023-09-18",
"2023-09-25"
"2023-09-25",
"2023-10-02"
],
"AWS_POPULATION_DENSITY": [
"2020-05-01"
Expand Down Expand Up @@ -5481,7 +5487,17 @@
"2023-10-02",
"2023-10-03",
"2023-10-04",
"2023-10-05"
"2023-10-05",
"2023-10-06",
"2023-10-07",
"2023-10-08",
"2023-10-09",
"2023-10-10",
"2023-10-11",
"2023-10-12",
"2023-10-13",
"2023-10-14",
"2023-10-15"
],
"AWS_VIS_RELHUMIDITY1000HPA": [
"1959-01-01",
Expand Down Expand Up @@ -7002,7 +7018,22 @@
"2023-09-29",
"2023-09-30",
"2023-10-01",
"2023-10-02"
"2023-10-02",
"2023-10-03",
"2023-10-04",
"2023-10-05",
"2023-10-06",
"2023-10-07",
"2023-10-08",
"2023-10-09",
"2023-10-10",
"2023-10-11",
"2023-10-12",
"2023-10-13",
"2023-10-14",
"2023-10-15",
"2023-10-16",
"2023-10-17"
],
"AWS_VIS_SST_MAPS": [
"2019-01-05",
Expand Down Expand Up @@ -7247,7 +7278,9 @@
"2023-09-02",
"2023-09-09",
"2023-09-16",
"2023-09-23"
"2023-09-23",
"2023-09-30",
"2023-10-07"
],
"AWS_VIS_WIND_U_10M": [
"1959-01-01",
Expand Down Expand Up @@ -9515,6 +9548,20 @@
"2012-02-01",
"2012-03-01"
],
"GHS_BUILT_S": [
"1975-01-01",
"1980-01-01",
"1985-01-01",
"1990-01-01",
"1995-01-01",
"2000-01-01",
"2005-01-01",
"2010-01-01",
"2015-01-01",
"2020-01-01",
"2025-01-01",
"2030-01-01"
],
"IS2SITMOGR4-cog": [
[
"2018-11-01T00:00:00",
Expand Down Expand Up @@ -22886,8 +22933,8 @@
"2023-05-16T11:59:30.000Z",
"2023-06-15T23:59:30.000Z",
"2023-07-16T11:59:30.000Z",
"2023-08-16T11:59:30.000Z"
],
"2023-08-16T11:59:30.000Z",
"2023-09-15T23:59:30.000Z"],
"PRC-Anomaly-GSMaP-World-Monthly": [
"2022-01-16T11:59:30.000Z",
"2022-02-14T23:59:30.000Z",
Expand Down Expand Up @@ -59734,4 +59781,4 @@
"s3://veda-data-store-staging/no2-monthly-diff/OMI_trno2_0.10x0.10_202212_Col3_V4.nc.tif"
]
]
}
}
43 changes: 43 additions & 0 deletions app/src/config/esa.js
Original file line number Diff line number Diff line change
Expand Up @@ -709,6 +709,10 @@ export const indicatorsDefinition = Object.freeze({
themes: ['air'],
story: '/eodash-data/stories/CDS',
},
GHSBUILT: {
themes: ['economy'],
story: '/eodash-data/stories/GHSBUILT',
},
d: { // dummy for locations without Indicator code
indicatorSummary: 'Upcoming data',
themes: ['economy'],
Expand Down Expand Up @@ -911,6 +915,45 @@ export const globalIndicators = [
},
},
*/
{
properties: {
indicatorObject: {
dataLoadFinished: true,
country: 'all',
city: 'World',
siteName: 'global',
description: 'GHS built-up surface dataset GHS-BUILT-S_GLOBE_R2023A',
indicator: 'GHSBUILT',
indicatorName: 'GHS-BUILT-S-R2023A',
subAoi: {
type: 'FeatureCollection',
features: [],
},
aoiID: 'World',
time: availableDates['GHS_BUILT_S'],

Check failure on line 933 in app/src/config/esa.js

View workflow job for this annotation

GitHub Actions / deploy

["GHS_BUILT_S"] is better written in dot notation
inputData: [''],
yAxis: '',
display: {
customAreaIndicator: true,
baseUrl: `https://services.sentinel-hub.com/ogc/wms/${shConfig.shInstanceId}`,
name: 'GHS-BUILT-S_GLOBE_R2023A',
layers: 'GHS_BUILT_S',
minZoom: 1,
legendUrl: 'legends/esa/GHS-BUILT-S_GLOBE_R2023A.png',
dateFormatFunction: (date) => DateTime.fromISO(date).toFormat('yyyy-MM-dd'),
areaIndicator: {
...statisticalApiHeaders,
...statisticalApiBody(
evalScriptsDefinitions['GHS-BUILT-S_GLOBE_R2023A'],
'byoc-0c7aa265-50f9-4947-9980-2ee5ae204803',
),
callbackFunction: parseStatAPIResponse,
areaFormatFunction: (area) => ({ area: wkt.read(JSON.stringify(area)).write() }),
},
},
},
},
},
{
properties: {
indicatorObject: {
Expand Down
43 changes: 43 additions & 0 deletions app/src/config/trilateral.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,10 @@ const sharedPalsarFNFConfig = Object.freeze({
});

export const indicatorsDefinition = Object.freeze({
GHSBUILT: {
themes: ['economy'],
story: '/eodash-data/stories/GHSBUILT',
},
NLK: {
indicatorSummary: 'Lakes',
story: '/data/trilateral/NLK',
Expand Down Expand Up @@ -993,6 +997,45 @@ const getWeeklyDates = (start, end) => {
};

export const globalIndicators = [
{
properties: {
indicatorObject: {
dataLoadFinished: true,
country: 'all',
city: 'World',
siteName: 'global',
description: 'GHS built-up surface dataset GHS-BUILT-S_GLOBE_R2023A',
indicator: 'GHSBUILT',
indicatorName: 'GHS-BUILT-S-R2023A',
subAoi: {
type: 'FeatureCollection',
features: [],
},
aoiID: 'World',
time: availableDates['GHS_BUILT_S'],

Check failure on line 1015 in app/src/config/trilateral.js

View workflow job for this annotation

GitHub Actions / deploy

["GHS_BUILT_S"] is better written in dot notation
inputData: [''],
yAxis: '',
display: {
customAreaIndicator: true,
baseUrl: `https://services.sentinel-hub.com/ogc/wms/${shConfig.shInstanceId}`,
name: 'GHS-BUILT-S_GLOBE_R2023A',
layers: 'GHS_BUILT_S',
minZoom: 1,
legendUrl: 'legends/esa/GHS-BUILT-S_GLOBE_R2023A.png',
dateFormatFunction: (date) => DateTime.fromISO(date).toFormat('yyyy-MM-dd'),
areaIndicator: {
...statisticalApiHeaders,
...statisticalApiBody(
evalScriptsDefinitions['GHS-BUILT-S_GLOBE_R2023A'],
'byoc-0c7aa265-50f9-4947-9980-2ee5ae204803',
),
callbackFunction: parseStatAPIResponse,
areaFormatFunction: (area) => ({ area: wkt.read(JSON.stringify(area)).write() }),
},
},
},
},
},
{
properties: {
indicatorObject: {
Expand Down
1 change: 1 addition & 0 deletions app/src/helpers/customAreaObjects.js
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,7 @@ export const evalScriptsDefinitions = Object.freeze({
AWS_VIS_CHL_MAPS: defaultEvalScriptDef('chl', 2e3),
AWS_VIS_TSM_MAPS: defaultEvalScriptDef('tsmnn', 2e3),
LAKES_SURFACE_WATER_TEMPERATURE: defaultEvalScriptDef('waterTemperature'),
"GHS-BUILT-S_GLOBE_R2023A": defaultEvalScriptDef('BUILT'),

Check failure on line 208 in app/src/helpers/customAreaObjects.js

View workflow job for this annotation

GitHub Actions / deploy

Strings must use singlequote
});

// Define custom fetch function with configurable timeout
Expand Down
1 change: 1 addition & 0 deletions app/src/scripts/generate_files.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ def try_parsing_date(text, line):
"AWS_VIS_SST_MAPS",
"LAKES_SURFACE_WATER_TEMPERATURE",
"LAKE_WATER_QUALITY_TURBIDITY_MEAN",
"GHS_BUILT_S",
]

ZARRCOLLECTIONS = [
Expand Down

0 comments on commit ac017be

Please sign in to comment.