diff --git a/api/app/main.py b/api/app/main.py index 323da3edd..169b5df90 100644 --- a/api/app/main.py +++ b/api/app/main.py @@ -18,7 +18,7 @@ from app.models import AcledRequest, RasterGeotiffModel from app.timer import timed from app.validation import validate_intersect_parameter -from app.zonal_stats import GroupBy, calculate_stats, get_wfs_response +from app.zonal_stats import DEFAULT_STATS, GroupBy, calculate_stats, get_wfs_response from fastapi import Depends, FastAPI, HTTPException, Path, Query, Response from fastapi.middleware.cors import CORSMiddleware from fastapi.responses import JSONResponse @@ -146,7 +146,7 @@ def stats(stats_model: StatsModel) -> list[dict[str, Any]]: features = _calculate_stats( zones, geotiff, - stats=" ".join(["min", "max", "mean", "median", "sum", "std"]), + stats=" ".join(DEFAULT_STATS), prefix="stats_", group_by=group_by, geojson_out=geojson_out, @@ -356,7 +356,7 @@ def stats_demo( features = _calculate_stats( zones_filepath, geotiff, - stats=" ".join(["min", "max", "mean", "median", "sum", "std"]), + stats=" ".join(DEFAULT_STATS), prefix="stats_", group_by=group_by, geojson_out=geojson_out, diff --git a/api/app/raster_utils.py b/api/app/raster_utils.py index cd26d3a4b..e0abc0b77 100644 --- a/api/app/raster_utils.py +++ b/api/app/raster_utils.py @@ -5,7 +5,7 @@ import rasterio from app.timer import timed -from rasterio.warp import Resampling, calculate_default_transform, reproject +from rasterio.warp import CRS, Resampling, calculate_default_transform, reproject from .models import FilePath @@ -99,3 +99,17 @@ def reproj_match( dst_crs=dst_crs, resampling=resampling_mode, ) + + +def calculate_pixel_area(geotiff_file): + with rasterio.open(geotiff_file) as dataset: + crs = dataset.crs + # Get pixel width and height in the CRS units + _, pixel_width, pixel_height = calculate_default_transform( + crs, CRS.from_epsg(4326), dataset.width, dataset.height, *dataset.bounds + ) + + # Convert pixel width and height to square kilometers + area = pixel_width * pixel_height / 1e6 + + return area diff --git a/api/app/tests/test_calculate.py b/api/app/tests/test_calculate.py index 6dcad7559..bb3bb1ca7 100644 --- a/api/app/tests/test_calculate.py +++ b/api/app/tests/test_calculate.py @@ -64,7 +64,6 @@ def test_calculate_stats_with_group_by(): geotiff, group_by="ADM1_PCODE", geojson_out=False, - intersect_comparison=(operator.lt, 1), ) assert len(features) == 4 diff --git a/api/app/zonal_stats.py b/api/app/zonal_stats.py index d38697983..afe9d6bb6 100644 --- a/api/app/zonal_stats.py +++ b/api/app/zonal_stats.py @@ -4,7 +4,7 @@ from datetime import datetime from json import dump, load from pathlib import Path -from typing import Any, Optional +from typing import Any, NewType, Optional from urllib.parse import urlencode import numpy as np @@ -12,18 +12,17 @@ from app.caching import CACHE_DIRECTORY, cache_file, get_json_file, is_file_valid from app.models import ( FilePath, - FilterProperty, GeoJSON, GeoJSONFeature, - Geometry, GroupBy, WfsParamsModel, WfsResponse, ) -from app.raster_utils import gdal_calc, reproj_match +from app.raster_utils import calculate_pixel_area, gdal_calc, reproj_match from app.timer import timed from app.validation import VALID_OPERATORS from fastapi import HTTPException +from osgeo import gdal from rasterio.warp import Resampling from rasterstats import zonal_stats # type: ignore from shapely.geometry import mapping, shape # type: ignore @@ -32,7 +31,10 @@ logger = logging.getLogger(__name__) -DEFAULT_STATS = ["min", "max", "mean", "median"] +DEFAULT_STATS = ["min", "max", "mean", "median", "sum", "std", "nodata", "count"] + +AreaInSqKm = NewType("AreaInSqKm", float) +Percentage = NewType("Percentage", float) def get_wfs_response(wfs_params: WfsParamsModel) -> WfsResponse: @@ -269,6 +271,8 @@ def calculate_stats( prefix: Optional[str] = "stats_", geojson_out: bool = False, wfs_response: Optional[WfsResponse] = None, + # WARNING - currently, when intersect_comparison is used, + # regions with 0 overlap are excluded from the results. intersect_comparison: Optional[tuple] = None, mask_geotiff: Optional[str] = None, mask_calc_expr: Optional[str] = None, @@ -335,19 +339,24 @@ def calculate_stats( # Add function to calculate overlap percentage. add_stats = None if intersect_comparison is not None: + pixel_area = calculate_pixel_area(geotiff) - def intersect_percentage(masked) -> float: - # Get total number of elements in the boundary. + def intersect_pixels(masked) -> float: + # Get total number of elements matching our operator in the boundary. intersect_operator, intersect_baseline = intersect_comparison # type: ignore + # If total is 0, no need to count. This avoids returning NaN. total = masked.count() - # Avoid dividing by 0 if total == 0: - return 0 - percentage = (intersect_operator(masked, intersect_baseline)).sum() - return percentage / total + return 0.0 + return float((intersect_operator(masked, intersect_baseline)).sum()) + + def intersect_area(masked) -> AreaInSqKm: + # Area in sq km per pixel value + return AreaInSqKm(intersect_pixels(masked) * pixel_area) add_stats = { - "intersect_percentage": intersect_percentage, + "intersect_pixels": intersect_pixels, + "intersect_area": intersect_area, } try: @@ -359,15 +368,58 @@ def intersect_percentage(masked) -> float: geojson_out=geojson_out, add_stats=add_stats, ) + except rasterio.errors.RasterioError as error: logger.error(error) raise HTTPException( status_code=500, detail="An error occured calculating statistics." ) from error # This Exception is raised by rasterstats library when feature collection as 0 elements within the feature array. - except ValueError as error: + except ValueError: stats_results = [] + # cleanup data and remove nan values + # add intersect stats if requested + clean_results = [] + for result in stats_results: + stats_properties: dict = result if not geojson_out else result["properties"] + + # clean results + clean_stats_properties = { + k: 0 if str(v).lower() == "nan" else v for k, v in stats_properties.items() + } + + # calculate intersect_percentage + if intersect_comparison is not None: + safe_prefix = prefix or "" + total = ( + float(clean_stats_properties[f"{safe_prefix}count"]) + + clean_stats_properties[f"{safe_prefix}nodata"] + ) + if total == 0: + intersect_percentage = Percentage(0.0) + else: + intersect_percentage = Percentage( + clean_stats_properties[f"{safe_prefix}intersect_pixels"] / total + ) + + clean_stats_properties = { + **clean_stats_properties, + f"{safe_prefix}intersect_percentage": intersect_percentage, + } + + # merge properties back at the proper level + # and filter out properties that have "no" intersection + # by setting a limit at 0.005 (0.5%). + if intersect_comparison is not None and intersect_percentage < 0.005: + continue + if not geojson_out: + clean_results.append(clean_stats_properties) + else: + clean_results.append({**result, "properties": clean_stats_properties}) + + stats_results = clean_results + if not geojson_out: feature_properties = _extract_features_properties(zones_filepath) diff --git a/frontend/src/components/MapView/Layers/AnalysisLayer/index.tsx b/frontend/src/components/MapView/Layers/AnalysisLayer/index.tsx index b34c0d800..7dd4f03a4 100644 --- a/frontend/src/components/MapView/Layers/AnalysisLayer/index.tsx +++ b/frontend/src/components/MapView/Layers/AnalysisLayer/index.tsx @@ -9,7 +9,7 @@ import { isAnalysisLayerActiveSelector, } from 'context/analysisResultStateSlice'; import { legendToStops } from 'components/MapView/Layers/layer-utils'; -import { LegendDefinition } from 'config/types'; +import { AggregationOperations, LegendDefinition, units } from 'config/types'; import { BaselineLayerResult, ExposedPopulationResult, @@ -18,6 +18,7 @@ import { import { getRoundedData } from 'utils/data-utils'; import { useSafeTranslation } from 'i18n'; import { LayerDefinitions } from 'config/utils'; +import { formatIntersectPercentageAttribute } from 'components/MapView/utils'; function AnalysisLayer({ before }: { before?: string }) { // TODO maybe in the future we can try add this to LayerType so we don't need exclusive code in Legends and MapView to make this display correctly @@ -102,18 +103,37 @@ function AnalysisLayer({ before }: { before?: string }) { const statisticKey = analysisData.statistic; const precision = analysisData instanceof ExposedPopulationResult ? 0 : undefined; + const formattedProperties = formatIntersectPercentageAttribute( + evt.features[0].properties, + ); dispatch( addPopupData({ [analysisData.getStatTitle(t)]: { - data: getRoundedData( - get(evt.features[0], ['properties', statisticKey]), + data: `${getRoundedData( + formattedProperties[statisticKey], t, precision, - ), + )} ${units[statisticKey] || ''}`, coordinates, }, }), ); + if (statisticKey === AggregationOperations['Area exposed']) { + dispatch( + addPopupData({ + [`${ + analysisData.getHazardLayer().title + } (Area exposed in km²)`]: { + data: `${getRoundedData( + formattedProperties.stats_intersect_area || null, + t, + precision, + )} ${units.stats_intersect_area}`, + coordinates, + }, + }), + ); + } } if (analysisData instanceof BaselineLayerResult) { diff --git a/frontend/src/components/MapView/LeftPanel/AnalysisPanel/index.tsx b/frontend/src/components/MapView/LeftPanel/AnalysisPanel/index.tsx index 388b98f6d..e843a1c4c 100644 --- a/frontend/src/components/MapView/LeftPanel/AnalysisPanel/index.tsx +++ b/frontend/src/components/MapView/LeftPanel/AnalysisPanel/index.tsx @@ -25,6 +25,7 @@ import { Theme, CircularProgress, Box, + MenuItem, } from '@material-ui/core'; import { BarChartOutlined, @@ -74,6 +75,8 @@ import { BoundaryLayerProps, GeometryType, PanelSize, + ExposureOperator, + ExposureValue, } from 'config/types'; import { getAdminLevelCount, getAdminLevelLayer } from 'utils/admin-utils'; import { LayerData } from 'context/layers/layer-data'; @@ -185,6 +188,12 @@ const AnalysisPanel = memo( const [hazardLayerId, setHazardLayerId] = useState( hazardLayerIdFromUrl, ); + + const [exposureValue, setExposureValue] = useState({ + operator: ExposureOperator.EQUAL, + value: '', + }); + const [statistic, setStatistic] = useState( (selectedStatisticFromUrl as AggregationOperations) || AggregationOperations.Mean, @@ -539,6 +548,14 @@ const AnalysisPanel = memo( updateHistory, ]); + const scaleThreshold = useCallback( + (threshold: number) => + statistic === AggregationOperations['Area exposed'] + ? threshold / 100 + : threshold, + [statistic], + ); + const runAnalyser = useCallback(async () => { if (preSelectedBaselineLayer) { setPreviousBaselineId(preSelectedBaselineLayer.id); @@ -614,10 +631,11 @@ const AnalysisPanel = memo( baselineLayer: selectedBaselineLayer, date: selectedDate, statistic, + exposureValue, extent, threshold: { - above: parseFloat(aboveThreshold) || undefined, - below: parseFloat(belowThreshold) || undefined, + above: scaleThreshold(parseFloat(aboveThreshold)) || undefined, + below: scaleThreshold(parseFloat(belowThreshold)) || undefined, }, }; @@ -634,27 +652,29 @@ const AnalysisPanel = memo( dispatch(requestAndStoreAnalysis(params)); } }, [ - aboveThreshold, - activateUniqueBoundary, - adminLevel, - adminLevelLayer, - adminLevelLayerData, + preSelectedBaselineLayer, analysisResult, - baselineLayerId, - belowThreshold, - clearAnalysis, - dispatch, - endDate, extent, + selectedHazardLayer, hazardDataType, - hazardLayerId, - preSelectedBaselineLayer, removeKeyFromUrl, - selectedDate, - selectedHazardLayer, + dispatch, + clearAnalysis, startDate, - statistic, + endDate, + adminLevelLayer, + adminLevelLayerData, + adminLevel, + activateUniqueBoundary, updateAnalysisParams, + hazardLayerId, + statistic, + selectedDate, + baselineLayerId, + exposureValue, + scaleThreshold, + aboveThreshold, + belowThreshold, ]); // handler of changing exposure analysis sort order @@ -743,7 +763,7 @@ const AnalysisPanel = memo( return ( <>
- + {t('Admin Level')}
- + {t('Date Range')}
- + {t('Start')}
- + {t('End')}
- + {t('Statistic')} @@ -853,12 +867,66 @@ const AnalysisPanel = memo( {statisticOptions} + {statistic === AggregationOperations['Area exposed'] && ( +
+ + + setExposureValue({ + ...exposureValue, + operator: e.target.value as ExposureOperator, + }) + } + > + {Object.values(ExposureOperator).map(item => ( + + {item} + + ))} + + + + + setExposureValue({ + ...exposureValue, + value: e.target.value as ExposureOperator, + }) + } + > + {selectedHazardLayer?.legend?.map(item => ( + + {`${item.label} (${item.value})`} + + ))} + + +
+ )}
- + {t('Threshold')} -
+
+ {statistic === AggregationOperations['Area exposed'] && ( + + % + + )}
- + {`${t('Date')}: `} ); }, [ - aboveThreshold, - availableHazardDates, - baselineLayerId, - belowThreshold, + hazardDataType, classes.analysisPanelParamContainer, classes.analysisPanelParamText, - classes.analysisParamTitle, - classes.calendarPopper, - classes.datePickerContainer, + classes.colorBlack, + classes.exposureValueContainer, + classes.exposureValueOptionsInputContainer, + classes.exposureValueOptionsSelect, + classes.rowInputContainer, classes.numberField, - hazardDataType, - onOptionChange, - onThresholdOptionChange, - selectedDate, + classes.datePickerContainer, + classes.calendarPopper, + baselineLayerId, + t, statistic, + onOptionChange, statisticOptions, - t, + exposureValue, + selectedHazardLayer, thresholdError, + belowThreshold, + onThresholdOptionChange, + aboveThreshold, + selectedDate, + availableHazardDates, ]); const renderedAnalysisPanelInfo = useMemo(() => { @@ -1048,7 +1127,9 @@ const AnalysisPanel = memo( !hazardLayerId || // or hazard layer hasn't been selected (hazardDataType === GeometryType.Polygon ? !startDate || !endDate || !adminLevelLayerData - : !selectedDate || !baselineLayerId) // or date hasn't been selected // or baseline layer hasn't been selected + : !selectedDate || !baselineLayerId) || // or date hasn't been selected // or baseline layer hasn't been selected + (statistic === AggregationOperations['Area exposed'] && + (!exposureValue.operator || !exposureValue.value)) } > {t('Run Analysis')} @@ -1063,12 +1144,15 @@ const AnalysisPanel = memo( classes.analysisButtonContainer, classes.bottomButton, endDate, + exposureValue.operator, + exposureValue.value, hazardDataType, hazardLayerId, isAnalysisLoading, runAnalyser, selectedDate, startDate, + statistic, t, thresholdError, ]); @@ -1166,6 +1250,29 @@ const styles = (theme: Theme) => justifyContent: 'center', alignItems: 'center', }, + exposureValueContainer: { + display: 'flex', + flexDirection: 'row', + gap: '16px', + }, + exposureValueOptionsInputContainer: { + flex: 1, + flexDirection: 'row', + alignItems: 'center', + margin: '8px 0', + }, + exposureValueOptionsSelect: { + width: '100%', + '& .MuiInputBase-root': { + color: 'black', + }, + '& .MuiFormLabel-root': { + color: 'black', + '&:hover fieldset': { + borderColor: '#333333', + }, + }, + }, exposureAnalysisLoadingTextContainer: { display: 'flex', justifyContent: 'center', @@ -1178,7 +1285,7 @@ const styles = (theme: Theme) => padding: '30px 10px 10px 10px', height: '100%', }, - analysisParamTitle: { + colorBlack: { color: 'black', }, analysisPanelParamText: { @@ -1247,7 +1354,6 @@ const styles = (theme: Theme) => }, numberField: { paddingRight: '10px', - marginTop: '10px', maxWidth: '140px', '& .MuiInputBase-root': { color: 'black', @@ -1256,6 +1362,11 @@ const styles = (theme: Theme) => color: '#333333', }, }, + rowInputContainer: { + display: 'flex', + alignItems: 'center', + marginTop: '10px', + }, calendarPopper: { zIndex: 3, }, diff --git a/frontend/src/components/MapView/__snapshots__/index.test.tsx.snap b/frontend/src/components/MapView/__snapshots__/index.test.tsx.snap index bd89efda1..e755ea512 100644 --- a/frontend/src/components/MapView/__snapshots__/index.test.tsx.snap +++ b/frontend/src/components/MapView/__snapshots__/index.test.tsx.snap @@ -3494,10 +3494,10 @@ exports[`renders as expected 1`] = `
diff --git a/frontend/src/components/MapView/utils.ts b/frontend/src/components/MapView/utils.ts index 4e10500ed..b4d1eca3b 100644 --- a/frontend/src/components/MapView/utils.ts +++ b/frontend/src/components/MapView/utils.ts @@ -187,6 +187,32 @@ export const filterActiveLayers = ( ); }; +export const formatIntersectPercentageAttribute = ( + /* eslint-disable camelcase */ + data: { + intersect_percentage?: string | number; + stats_intersect_area?: string | number; + [key: string]: any; + }, +) => { + /* eslint-disable fp/no-mutation */ + let transformedData = data; + if (parseInt((data.intersect_percentage as unknown) as string, 10) >= 0) { + transformedData = { + ...transformedData, + intersect_percentage: 100 * ((data.intersect_percentage as number) || 0), + }; + } + if (data.stats_intersect_area) { + transformedData = { + ...transformedData, + stats_intersect_area: data.stats_intersect_area, + }; + } + /* eslint-enable fp/no-mutation */ + return transformedData; +}; + const getExposureAnalysisTableCellValue = ( value: string | number, column: Column, diff --git a/frontend/src/config/cambodia/layers.json b/frontend/src/config/cambodia/layers.json index ac9b32b83..15ae9fbaa 100644 --- a/frontend/src/config/cambodia/layers.json +++ b/frontend/src/config/cambodia/layers.json @@ -715,46 +715,57 @@ "legend_text": "1-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -775,46 +786,57 @@ "legend_text": "3-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -835,46 +857,57 @@ "legend_text": "6-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -895,46 +928,57 @@ "legend_text": "9-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -955,46 +999,57 @@ "legend_text": "1-year Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } diff --git a/frontend/src/config/cameroon/layers.json b/frontend/src/config/cameroon/layers.json index ed1861101..d1b6727a7 100644 --- a/frontend/src/config/cameroon/layers.json +++ b/frontend/src/config/cameroon/layers.json @@ -50,46 +50,57 @@ "legend_text": "1-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -110,46 +121,57 @@ "legend_text": "3-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -230,46 +252,57 @@ "legend_text": "9-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -290,46 +323,57 @@ "legend_text": "1-year Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -3635,13 +3679,28 @@ "title": "Phase classification", "type": "admin_level_data", "path": "data/cameroon/ch/admin2_{YYYY_MM_DD}.json", - "dates": ["2018-02-01", "2018-06-01", "2018-10-01", "2019-02-01", "2019-06-01", "2019-10-01", "2020-02-01", "2020-06-01", "2020-10-01", "2021-02-01", "2021-06-01", "2021-10-01", "2022-02-01", "2022-06-01", "2022-10-01", "2023-06-01"], - "fallbackLayerKeys": [ - "ch_phase_admin1" + "dates": [ + "2018-02-01", + "2018-06-01", + "2018-10-01", + "2019-02-01", + "2019-06-01", + "2019-10-01", + "2020-02-01", + "2020-06-01", + "2020-10-01", + "2021-02-01", + "2021-06-01", + "2021-10-01", + "2022-02-01", + "2022-06-01", + "2022-10-01", + "2023-06-01" ], + "fallbackLayerKeys": ["ch_phase_admin1"], "validityPeriod": { - "start_date_field" : "start_date", - "end_date_field" : "end_date" + "start_date_field": "start_date", + "end_date_field": "end_date" }, "admin_level": 2, "data_field": "calc_ph_admin2", @@ -3785,17 +3844,32 @@ "title": "Population in phase 3 to 5", "type": "admin_level_data", "path": "data/cameroon/ch/admin2_{YYYY_MM_DD}.json", - "dates": ["2018-02-01", "2018-06-01", "2018-10-01", "2019-02-01", "2019-06-01", "2019-10-01", "2020-02-01", "2020-06-01", "2020-10-01", "2021-02-01", "2021-06-01", "2021-10-01", "2022-02-01", "2022-06-01", "2022-10-01", "2023-06-01"], + "dates": [ + "2018-02-01", + "2018-06-01", + "2018-10-01", + "2019-02-01", + "2019-06-01", + "2019-10-01", + "2020-02-01", + "2020-06-01", + "2020-10-01", + "2021-02-01", + "2021-06-01", + "2021-10-01", + "2022-02-01", + "2022-06-01", + "2022-10-01", + "2023-06-01" + ], "validityPeriod": { - "start_date_field" : "start_date", - "end_date_field" : "end_date" + "start_date_field": "start_date", + "end_date_field": "end_date" }, "data_field": "calc_pop_ph3_5_admin2", "admin_level": 2, "admin_code": "adm2_pcod2", - "fallbackLayerKeys": [ - "ch_pop3_5_admin1" - ], + "fallbackLayerKeys": ["ch_pop3_5_admin1"], "feature_info_props": { "calc_pop_ph1_admin2": { "type": "number", @@ -3965,15 +4039,13 @@ "2022-10-01" ], "validityPeriod": { - "start_date_field" : "start_date", - "end_date_field" : "end_date" + "start_date_field": "start_date", + "end_date_field": "end_date" }, "admin_level": 2, "data_field": "phase_class", "admin_code": "adm2_pcod2", - "fallbackLayerKeys": [ - "ch_idps_phase_admin1" - ], + "fallbackLayerKeys": ["ch_idps_phase_admin1"], "opacity": 0.9, "feature_info_props": { "start_date": { @@ -4028,8 +4100,8 @@ "2022-10-01" ], "validityPeriod": { - "start_date_field" : "start_date", - "end_date_field" : "end_date" + "start_date_field": "start_date", + "end_date_field": "end_date" }, "admin_level": 1, "data_field": "calc_ph_admin1", @@ -4088,15 +4160,13 @@ "2022-10-01" ], "validityPeriod": { - "start_date_field" : "start_date", - "end_date_field" : "end_date" + "start_date_field": "start_date", + "end_date_field": "end_date" }, "admin_level": 2, "data_field": "calc_pop_ph3_5_admin2", "admin_code": "adm2_pcod2", - "fallbackLayerKeys": [ - "ch_idps_phase_admin1" - ], + "fallbackLayerKeys": ["ch_idps_phase_admin1"], "opacity": 0.9, "feature_info_props": { "start_date": { @@ -4161,8 +4231,8 @@ "2022-10-01" ], "validityPeriod": { - "start_date_field" : "start_date", - "end_date_field" : "end_date" + "start_date_field": "start_date", + "end_date_field": "end_date" }, "admin_level": 1, "data_field": "calc_pop_ph3_5_admin1", @@ -4233,8 +4303,8 @@ "2022-10-01" ], "validityPeriod": { - "start_date_field" : "start_date", - "end_date_field" : "end_date" + "start_date_field": "start_date", + "end_date_field": "end_date" }, "admin_level": 2, "data_field": "phase_class", @@ -4295,8 +4365,8 @@ "2022-10-01" ], "validityPeriod": { - "start_date_field" : "start_date", - "end_date_field" : "end_date" + "start_date_field": "start_date", + "end_date_field": "end_date" }, "admin_level": 2, "data_field": "calc_pop_ph3_5_admin2", @@ -4355,13 +4425,10 @@ "title": "Urban areas - phase classification", "type": "admin_level_data", "path": "data/cameroon/ch/urb_admin2_{YYYY_MM_DD}.json", - "dates": [ - "2022-02-01", - "2022-06-01" - ], + "dates": ["2022-02-01", "2022-06-01"], "validityPeriod": { - "start_date_field" : "start_date", - "end_date_field" : "end_date" + "start_date_field": "start_date", + "end_date_field": "end_date" }, "admin_level": 2, "data_field": "phase_class", @@ -4410,10 +4477,7 @@ "title": "Urban areas - population in phase 3 to 5", "type": "admin_level_data", "path": "data/cameroon/ch/urb_admin2_{YYYY_MM_DD}.json", - "dates": [ - "2022-02-01", - "2022-06-01" - ], + "dates": ["2022-02-01", "2022-06-01"], "admin_level": 2, "data_field": "calc_pop_ph3_5_admin2", "admin_code": "adm2_pcod2", @@ -4467,4 +4531,4 @@ ], "legend_text": "Urban areas - population in phase 3 to 5" } -} \ No newline at end of file +} diff --git a/frontend/src/config/colombia/layers.json b/frontend/src/config/colombia/layers.json index 2a1f06f80..2c3c37c30 100644 --- a/frontend/src/config/colombia/layers.json +++ b/frontend/src/config/colombia/layers.json @@ -471,46 +471,57 @@ "legend_text": "1-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -531,46 +542,57 @@ "legend_text": "3-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -591,46 +613,57 @@ "legend_text": "6-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -651,46 +684,57 @@ "legend_text": "9-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -711,46 +755,57 @@ "legend_text": "1-year Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } diff --git a/frontend/src/config/cuba/layers.json b/frontend/src/config/cuba/layers.json index 2a33f6dde..f5c8b81d1 100644 --- a/frontend/src/config/cuba/layers.json +++ b/frontend/src/config/cuba/layers.json @@ -50,46 +50,57 @@ "legend_text": "1-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -110,46 +121,57 @@ "legend_text": "3-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -170,46 +192,57 @@ "legend_text": "6-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -230,46 +263,57 @@ "legend_text": "9-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -290,46 +334,57 @@ "legend_text": "1-year Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1240,7 +1295,7 @@ { "value": 14, "label": "13-14 Days", "color": "#a002fa" }, { "value": 15, "label": "> 14 Days", "color": "#ffc4ee" } ] - }, + }, "ndvi_dekad": { "title": "10-day NDVI (MODIS)", "type": "wms", @@ -1426,7 +1481,7 @@ { "value": 46, "label": "46C - 48C", "color": "#bf7f2f" }, { "value": 48, "label": "48C - 50C", "color": "#f88d52" } ] - }, + }, "lst_anomaly": { "title": "Daytime Land Surface Temperature - 10-day Anomaly (MODIS)", "type": "wms", diff --git a/frontend/src/config/global/layers.json b/frontend/src/config/global/layers.json index 8aab2aac2..2be957022 100644 --- a/frontend/src/config/global/layers.json +++ b/frontend/src/config/global/layers.json @@ -23,7 +23,8 @@ "server_layer_name": "rfq_dekad", "additional_query_params": { "styles": "rfq_14_20_400" - }, "base_url": "https://api.earthobservation.vam.wfp.org/ows/", + }, + "base_url": "https://api.earthobservation.vam.wfp.org/ows/", "date_interval": "days", "opacity": 0.7, "legend_text": "10-day precipitation anomaly compared to the long term average. Derived from CHIRPS (UCSB Climate Hazards Group). https://www.chc.ucsb.edu/data/chirps", @@ -362,7 +363,7 @@ { "value": 3000, "label": "3000-3500 mm", "color": "#a002fa" }, { "value": 3500, "label": "3500-4000 mm", "color": "#fa78fa" }, { "value": 4000, "label": "> 4000 mm", "color": "#ffc4ee" } - ] + ] }, "spi_1m": { "title": "SPI - 1-month", @@ -379,46 +380,57 @@ "legend_text": "1-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -439,46 +451,57 @@ "legend_text": "3-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -499,46 +522,57 @@ "legend_text": "6-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -559,46 +593,57 @@ "legend_text": "9-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -619,46 +664,57 @@ "legend_text": "1-year Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -716,7 +772,7 @@ { "value": 22, "label": "21-22 Days", "color": "#d79b0b" }, { "value": 26, "label": "23-26 Days", "color": "#c98a4b" }, { "value": 27, "label": "> 26 Days", "color": "#aa5a00" } - ] + ] }, "days_heavy_rain": { "title": "Number of days with heavy rainfall in the last 30 days", @@ -1033,7 +1089,7 @@ { "value": 64, "label": "64C - 66C", "color": "#67000d" }, { "value": 66, "label": "66C - 70C", "color": "#732600" }, { "value": 70, "label": "> 70C", "color": "#460000" } - ] + ] }, "lst_nighttime": { "title": "Nighttime Land Surface Temperature - 10-day (MODIS)", @@ -1094,7 +1150,7 @@ { "value": 64, "label": "64C - 66C", "color": "#67000d" }, { "value": 66, "label": "66C - 70C", "color": "#732600" }, { "value": 70, "label": "> 70C", "color": "#460000" } - ] + ] }, "lst_anomaly": { "title": "Daytime Land Surface Temperature - 10-day Anomaly (MODIS)", diff --git a/frontend/src/config/jordan/layers.json b/frontend/src/config/jordan/layers.json index 65eaca613..83bf8ce76 100644 --- a/frontend/src/config/jordan/layers.json +++ b/frontend/src/config/jordan/layers.json @@ -4,16 +4,8 @@ "path": "data/jordan/jor_admbnda_adm3_jdos_merged.json", "opacity": 0.8, "admin_code": "admin3Pcod", - "admin_level_names": [ - "admin1Name", - "admin2Name", - "admin3Name" - ], - "admin_level_local_names": [ - "admin1Na_1", - "admin2Na_1", - "admin3Na_1" - ], + "admin_level_names": ["admin1Name", "admin2Name", "admin3Name"], + "admin_level_local_names": ["admin1Na_1", "admin2Na_1", "admin3Na_1"], "styles:": { "fill": { "fill-opacity": 0 @@ -30,14 +22,8 @@ "path": "data/jordan/jor_admbnda_adm2_jdos.json", "opacity": 0.8, "admin_code": "admin2Pcod", - "admin_level_names": [ - "admin1Name", - "admin2Name" - ], - "admin_level_local_names": [ - "admin1Na_1", - "admin2Na_1" - ], + "admin_level_names": ["admin1Name", "admin2Name"], + "admin_level_local_names": ["admin1Na_1", "admin2Na_1"], "styles:": { "fill": { "fill-opacity": 0 @@ -54,12 +40,8 @@ "path": "data/jordan/jor_admbnda_adm1_jdos.json", "opacity": 0.8, "admin_code": "admin1Pcod", - "admin_level_names": [ - "admin1Name" - ], - "admin_level_local_names": [ - "admin1Na_1" - ], + "admin_level_names": ["admin1Name"], + "admin_level_local_names": ["admin1Na_1"], "styles:": { "fill": { "fill-opacity": 0 @@ -86,46 +68,57 @@ "legend_text": "1-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -146,46 +139,57 @@ "legend_text": "3-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -206,46 +210,57 @@ "legend_text": "6-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -266,46 +281,57 @@ "legend_text": "9-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -326,46 +352,57 @@ "legend_text": "1-year Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -3900,4 +3937,4 @@ ], "legend_text": "Groundwater developed for irrigation (MCM) " } -} \ No newline at end of file +} diff --git a/frontend/src/config/kyrgyzstan/layers.json b/frontend/src/config/kyrgyzstan/layers.json index ffd8ff718..f03efec99 100644 --- a/frontend/src/config/kyrgyzstan/layers.json +++ b/frontend/src/config/kyrgyzstan/layers.json @@ -4,14 +4,8 @@ "path": "data/kyrgyzstan/District_KRYG.json", "opacity": 1, "admin_code": "Adm2_Code", - "admin_level_names": [ - "Adm1_RU", - "Adm2_RU" - ], - "admin_level_local_names": [ - "Adm1_KR", - "Adm2_KR" - ], + "admin_level_names": ["Adm1_RU", "Adm2_RU"], + "admin_level_local_names": ["Adm1_KR", "Adm2_KR"], "styles:": { "fill": { "fill-opacity": 0 @@ -28,12 +22,8 @@ "path": "data/kyrgyzstan/Province_KYRG.json", "opacity": 1, "admin_code": "Adm1_Code", - "admin_level_names": [ - "Adm1_RU" - ], - "admin_level_local_names": [ - "Adm1_KR" - ], + "admin_level_names": ["Adm1_RU"], + "admin_level_local_names": ["Adm1_KR"], "styles:": { "fill": { "fill-opacity": 0 @@ -443,12 +433,13 @@ "chart_data": { "url": "https://api.earthobservation.vam.wfp.org/stats/admin/fetch", "fields": [ - { "key": "rfq", - "label": "Rainfall anomaly", + { + "key": "rfq", + "label": "Rainfall anomaly", "color": "#375692", "minValue": 0, "maxValue": 300 - }, + }, { "key": "rfq_avg", "label": "Normal", @@ -470,7 +461,7 @@ } ], "type": "line" - }, + }, "base_url": "https://api.earthobservation.vam.wfp.org/ows/", "date_interval": "days", "opacity": 0.7, @@ -552,8 +543,9 @@ "chart_data": { "url": "https://api.earthobservation.vam.wfp.org/stats/admin/fetch", "fields": [ - { "key": "r1q", - "label": "Rainfall anomaly", + { + "key": "r1q", + "label": "Rainfall anomaly", "minValue": 0, "maxValue": 300, "color": "#375692" @@ -579,7 +571,7 @@ } ], "type": "line" - }, + }, "base_url": "https://api.earthobservation.vam.wfp.org/ows/", "date_interval": "days", "opacity": 0.7, @@ -627,7 +619,7 @@ } ], "type": "bar" - }, + }, "base_url": "https://api.earthobservation.vam.wfp.org/ows/", "date_interval": "days", "opacity": 0.7, @@ -650,7 +642,7 @@ { "value": 700, "label": "700-800 mm", "color": "#fa78fa" }, { "value": 800, "label": "> 800 mm", "color": "#ffc4ee" } ] - }, + }, "rain_anomaly_3month": { "title": "3-month rainfall anomaly", "type": "wms", @@ -661,11 +653,13 @@ "chart_data": { "url": "https://api.earthobservation.vam.wfp.org/stats/admin/fetch", "fields": [ - { "key": "r3q", - "label": "Rainfall anomaly", + { + "key": "r3q", + "label": "Rainfall anomaly", "minValue": 0, "maxValue": 300, - "color": "#375692" }, + "color": "#375692" + }, { "key": "rfq_avg", "label": "Normal", @@ -738,7 +732,7 @@ { "value": 1400, "label": "1400-1600 mm", "color": "#fa78fa" }, { "value": 1600, "label": "> 1600 mm", "color": "#ffc4ee" } ] - }, + }, "rain_anomaly_6month": { "title": "6-month rainfall anomaly", "type": "wms", @@ -796,7 +790,7 @@ { "value": 2000, "label": "2000-2400 mm", "color": "#fa78fa" }, { "value": 2400, "label": "> 2400 mm", "color": "#ffc4ee" } ] - }, + }, "rain_anomaly_9month": { "title": "9-month rainfall anomaly", "type": "wms", @@ -854,7 +848,7 @@ { "value": 2000, "label": "2000-2400 mm", "color": "#fa78fa" }, { "value": 2400, "label": "> 2400 mm", "color": "#ffc4ee" } ] - }, + }, "rain_anomaly_1year": { "title": "1-year rainfall anomaly", "type": "wms", @@ -898,46 +892,57 @@ "legend_text": "1-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -958,46 +963,57 @@ "legend_text": "3-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1018,46 +1034,57 @@ "legend_text": "6-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1078,46 +1105,57 @@ "legend_text": "9-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1138,46 +1176,57 @@ "legend_text": "1-year Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1235,7 +1284,7 @@ { "value": 22, "label": "21-22 Days", "color": "#d79b0b" }, { "value": 26, "label": "23-26 Days", "color": "#c98a4b" }, { "value": 27, "label": "> 26 Days", "color": "#aa5a00" } - ] + ] }, "days_heavy_rain": { "title": "Number of days with heavy rainfall in the last 30 days", @@ -1458,11 +1507,12 @@ "chart_data": { "url": "https://api.earthobservation.vam.wfp.org/stats/admin/fetch", "fields": [ - { "key": "viq", - "label": "NDVI anomaly", + { + "key": "viq", + "label": "NDVI anomaly", "minValue": 0, "maxValue": 150, - "color": "#5e803f" + "color": "#5e803f" }, { "key": "viq_avg", @@ -1985,4 +2035,4 @@ } ] } -} \ No newline at end of file +} diff --git a/frontend/src/config/mozambique/layers.json b/frontend/src/config/mozambique/layers.json index cba020bcd..76b572044 100644 --- a/frontend/src/config/mozambique/layers.json +++ b/frontend/src/config/mozambique/layers.json @@ -93,12 +93,13 @@ }, "chart_data": { "fields": [ - { "key": "rfq", - "label": "Rainfall anomaly", + { + "key": "rfq", + "label": "Rainfall anomaly", "color": "#375692", "minValue": 0, "maxValue": 300 - }, + }, { "key": "rfq_avg", "label": "Normal", @@ -152,10 +153,7 @@ "chart_data": { "url": "https://api.earthobservation.vam.wfp.org/stats/admin/fetch", "fields": [ - { "key": "rfb", - "label": "Rainfall", - "color": "#233f5f" - }, + { "key": "rfb", "label": "Rainfall", "color": "#233f5f" }, { "key": "rfb_avg", "label": "Average", @@ -209,11 +207,13 @@ "chart_data": { "url": "https://api.earthobservation.vam.wfp.org/stats/admin/fetch", "fields": [ - { "key": "rfq", - "label": "Rainfall anomaly", + { + "key": "rfq", + "label": "Rainfall anomaly", "minValue": 0, "maxValue": 300, - "color": "#375692" }, + "color": "#375692" + }, { "key": "rfq_avg", "label": "Normal", @@ -318,8 +318,9 @@ "opacity": 0.7, "chart_data": { "fields": [ - { "key": "r1q", - "label": "Rainfall anomaly", + { + "key": "r1q", + "label": "Rainfall anomaly", "minValue": 0, "maxValue": 300, "color": "#375692" @@ -425,11 +426,13 @@ "opacity": 0.7, "chart_data": { "fields": [ - { "key": "r3q", - "label": "Rainfall anomaly", + { + "key": "r3q", + "label": "Rainfall anomaly", "minValue": 0, "maxValue": 300, - "color": "#375692" }, + "color": "#375692" + }, { "key": "rfq_avg", "label": "Normal", @@ -730,7 +733,7 @@ { "value": 300, "label": "300-400%", "color": "#0000c8" }, { "value": 400, "label": "> 400%", "color": "#a002fa" } ] - }, + }, "precip_blended_3m": { "title": "Blended rainfall aggregate (3-month)", "type": "wms", @@ -790,7 +793,7 @@ { "value": 300, "label": "300-400%", "color": "#0000c8" }, { "value": 400, "label": "> 400%", "color": "#a002fa" } ] - }, + }, "precip_blended_6m": { "title": "Blended rainfall aggregate (6-month)", "type": "wms", @@ -850,7 +853,7 @@ { "value": 170, "label": "170-200%", "color": "#0000c8" }, { "value": 200, "label": "> 200%", "color": "#a002fa" } ] - }, + }, "precip_blended_9m": { "title": "Blended rainfall aggregate (9-month)", "type": "wms", @@ -910,7 +913,7 @@ { "value": 170, "label": "170-200%", "color": "#0000c8" }, { "value": 200, "label": "> 200%", "color": "#a002fa" } ] - }, + }, "precip_blended_1y": { "title": "Blended rainfall aggregate (1-year)", "type": "wms", @@ -970,7 +973,7 @@ { "value": 170, "label": "170-200%", "color": "#0000c8" }, { "value": 200, "label": "> 200%", "color": "#a002fa" } ] - }, + }, "streak_dry_days": { "title": "Longest dry spell", "type": "wms", @@ -1248,11 +1251,12 @@ }, "chart_data": { "fields": [ - { "key": "viq", - "label": "NDVI anomaly", + { + "key": "viq", + "label": "NDVI anomaly", "minValue": 0, "maxValue": 150, - "color": "#5e803f" + "color": "#5e803f" }, { "key": "viq_avg", @@ -1596,46 +1600,57 @@ "legend_text": "1-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1656,46 +1671,57 @@ "legend_text": "3-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1716,46 +1742,57 @@ "legend_text": "6-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1776,46 +1813,57 @@ "legend_text": "9-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1836,46 +1884,57 @@ "legend_text": "1-year Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } diff --git a/frontend/src/config/myanmar/layers.json b/frontend/src/config/myanmar/layers.json index 0d0475980..6fe46e2ee 100644 --- a/frontend/src/config/myanmar/layers.json +++ b/frontend/src/config/myanmar/layers.json @@ -998,46 +998,57 @@ "legend_text": "1-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1058,46 +1069,57 @@ "legend_text": "3-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1118,46 +1140,57 @@ "legend_text": "6-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1178,46 +1211,57 @@ "legend_text": "9-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1238,46 +1282,57 @@ "legend_text": "1-year Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } diff --git a/frontend/src/config/namibia/layers.json b/frontend/src/config/namibia/layers.json index bf14faa64..5df86b61c 100644 --- a/frontend/src/config/namibia/layers.json +++ b/frontend/src/config/namibia/layers.json @@ -232,7 +232,7 @@ { "value": 200, "label": "200-300 mm", "color": "#fa78fa" }, { "value": 300, "label": ">= 300 mm", "color": "#ffc4ee" } ] - }, + }, "rainfall_agg_1month": { "title": "1-month rainfall aggregate", "type": "wms", @@ -428,46 +428,57 @@ "legend_text": "1-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -488,46 +499,57 @@ "legend_text": "3-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -548,46 +570,57 @@ "legend_text": "6-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -608,46 +641,57 @@ "legend_text": "9-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -668,52 +712,63 @@ "legend_text": "1-year Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } ] }, - "precip_blended_dekad": { + "precip_blended_dekad": { "title": "Blended rainfall estimates (10-day)", "type": "wms", "server_layer_name": "rfb_blended_nam_dekad", @@ -1335,7 +1390,8 @@ "server_layer_name": "mxd13a2_viq_dekad", "additional_query_params": { "styles": "viq_13_50_150" - }, "base_url": "https://api.earthobservation.vam.wfp.org/ows/", + }, + "base_url": "https://api.earthobservation.vam.wfp.org/ows/", "date_interval": "days", "opacity": 0.7, "legend_text": "NDVI Anomaly compared to LTA", diff --git a/frontend/src/config/nigeria/layers.json b/frontend/src/config/nigeria/layers.json index fdc8d1dc9..cdcd29625 100644 --- a/frontend/src/config/nigeria/layers.json +++ b/frontend/src/config/nigeria/layers.json @@ -50,46 +50,57 @@ "legend_text": "1-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -110,46 +121,57 @@ "legend_text": "3-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -170,46 +192,57 @@ "legend_text": "6-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -230,46 +263,57 @@ "legend_text": "9-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -290,46 +334,57 @@ "legend_text": "1-year Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -3650,8 +3705,8 @@ "2023-06-01" ], "validityPeriod": { - "start_date_field" : "start_date", - "end_date_field" : "end_date" + "start_date_field": "start_date", + "end_date_field": "end_date" }, "fallbackLayerKeys": ["ch_phase_admin1"], "admin_level": 2, @@ -3815,8 +3870,8 @@ "2023-06-01" ], "validityPeriod": { - "start_date_field" : "start_date", - "end_date_field" : "end_date" + "start_date_field": "start_date", + "end_date_field": "end_date" }, "data_field": "calc_pop_ph3_5_admin2", "admin_level": 2, @@ -3993,8 +4048,8 @@ "2023-06-01" ], "validityPeriod": { - "start_date_field" : "start_date", - "end_date_field" : "end_date" + "start_date_field": "start_date", + "end_date_field": "end_date" }, "admin_level": 2, "data_field": "phase_class", @@ -4102,8 +4157,8 @@ "2023-06-01" ], "validityPeriod": { - "start_date_field" : "start_date", - "end_date_field" : "end_date" + "start_date_field": "start_date", + "end_date_field": "end_date" }, "admin_level": 2, "data_field": "calc_pop_ph3_5_admin2", @@ -4234,8 +4289,8 @@ "2023-06-01" ], "validityPeriod": { - "start_date_field" : "start_date", - "end_date_field" : "end_date" + "start_date_field": "start_date", + "end_date_field": "end_date" }, "admin_level": 2, "data_field": "phase_class", @@ -4298,8 +4353,8 @@ "2023-06-01" ], "validityPeriod": { - "start_date_field" : "start_date", - "end_date_field" : "end_date" + "start_date_field": "start_date", + "end_date_field": "end_date" }, "admin_level": 2, "data_field": "calc_pop_ph3_5_admin2", @@ -4361,8 +4416,8 @@ "path": "data/nigeria/ch/urb_admin2_{YYYY_MM_DD}.json", "dates": ["2021-02-01", "2021-06-01", "2022-02-01", "2022-06-01"], "validityPeriod": { - "start_date_field" : "start_date", - "end_date_field" : "end_date" + "start_date_field": "start_date", + "end_date_field": "end_date" }, "admin_level": 2, "data_field": "phase_class", @@ -4414,8 +4469,8 @@ "path": "data/nigeria/ch/urb_admin2_{YYYY_MM_DD}.json", "dates": ["2022-02-01", "2022-06-01", "2023-06-01"], "validityPeriod": { - "start_date_field" : "start_date", - "end_date_field" : "end_date" + "start_date_field": "start_date", + "end_date_field": "end_date" }, "admin_level": 2, "data_field": "calc_pop_ph3_5_admin2", @@ -4470,4 +4525,4 @@ ], "legend_text": "Urban areas - population in phase 3 to 5" } -} \ No newline at end of file +} diff --git a/frontend/src/config/rbd/layers.json b/frontend/src/config/rbd/layers.json index 1d22237a8..15bb59b64 100644 --- a/frontend/src/config/rbd/layers.json +++ b/frontend/src/config/rbd/layers.json @@ -1374,46 +1374,57 @@ "legend_text": "1-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1438,46 +1449,57 @@ "legend_text": "3-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1502,46 +1524,57 @@ "legend_text": "6-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1566,46 +1599,57 @@ "legend_text": "9-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1630,46 +1674,57 @@ "legend_text": "1-year Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -3515,8 +3570,8 @@ "2023-06-01" ], "validityPeriod": { - "start_date_field" : "start_date", - "end_date_field" : "end_date" + "start_date_field": "start_date", + "end_date_field": "end_date" }, "fallbackLayerKeys": ["ch_phase_admin1"], "admin_level": 2, @@ -3680,8 +3735,8 @@ "2023-06-01" ], "validityPeriod": { - "start_date_field" : "start_date", - "end_date_field" : "end_date" + "start_date_field": "start_date", + "end_date_field": "end_date" }, "data_field": "calc_pop_ph3_5_admin2", "admin_level": 2, @@ -3857,8 +3912,8 @@ "2023-06-01" ], "validityPeriod": { - "start_date_field" : "start_date", - "end_date_field" : "end_date" + "start_date_field": "start_date", + "end_date_field": "end_date" }, "admin_level": 2, "data_field": "phase_class", @@ -3965,8 +4020,8 @@ "2023-06-01" ], "validityPeriod": { - "start_date_field" : "start_date", - "end_date_field" : "end_date" + "start_date_field": "start_date", + "end_date_field": "end_date" }, "admin_level": 2, "data_field": "calc_pop_ph3_5_admin2", @@ -4097,8 +4152,8 @@ "2023-06-01" ], "validityPeriod": { - "start_date_field" : "start_date", - "end_date_field" : "end_date" + "start_date_field": "start_date", + "end_date_field": "end_date" }, "admin_level": 2, "data_field": "phase_class", @@ -4161,8 +4216,8 @@ "2023-06-01" ], "validityPeriod": { - "start_date_field" : "start_date", - "end_date_field" : "end_date" + "start_date_field": "start_date", + "end_date_field": "end_date" }, "admin_level": 2, "data_field": "calc_pop_ph3_5_admin2", @@ -4224,8 +4279,8 @@ "path": "data/rbd/ch/urb_admin2_{YYYY_MM_DD}.json", "dates": ["2022-02-01", "2022-06-01"], "validityPeriod": { - "start_date_field" : "start_date", - "end_date_field" : "end_date" + "start_date_field": "start_date", + "end_date_field": "end_date" }, "admin_level": 2, "data_field": "phase_class", @@ -4277,8 +4332,8 @@ "path": "data/rbd/ch/urb_admin2_{YYYY_MM_DD}.json", "dates": ["2022-02-01", "2022-06-01"], "validityPeriod": { - "start_date_field" : "start_date", - "end_date_field" : "end_date" + "start_date_field": "start_date", + "end_date_field": "end_date" }, "admin_level": 2, "data_field": "calc_pop_ph3_5_admin2", diff --git a/frontend/src/config/sierraleone/layers.json b/frontend/src/config/sierraleone/layers.json index 99a3fb4ca..0795ab491 100644 --- a/frontend/src/config/sierraleone/layers.json +++ b/frontend/src/config/sierraleone/layers.json @@ -71,7 +71,8 @@ "server_layer_name": "rfq_dekad", "additional_query_params": { "styles": "rfq_14_20_400" - }, "base_url": "https://api.earthobservation.vam.wfp.org/ows/", + }, + "base_url": "https://api.earthobservation.vam.wfp.org/ows/", "date_interval": "days", "opacity": 0.7, "legend_text": "10-day precipitation anomaly compared to the long term average. Derived from CHIRPS (UCSB Climate Hazards Group). https://www.chc.ucsb.edu/data/chirps", @@ -397,46 +398,57 @@ "legend_text": "1-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -457,46 +469,57 @@ "legend_text": "3-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -517,46 +540,57 @@ "legend_text": "6-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -577,46 +611,57 @@ "legend_text": "9-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -637,46 +682,57 @@ "legend_text": "1-year Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -734,7 +790,7 @@ { "value": 22, "label": "21-22 Days", "color": "#d79b0b" }, { "value": 26, "label": "23-26 Days", "color": "#c98a4b" }, { "value": 27, "label": "> 26 Days", "color": "#aa5a00" } - ] + ] }, "days_heavy_rain": { "title": "Number of days with heavy rainfall in the last 30 days", @@ -1121,4 +1177,4 @@ { "value": 12, "label": "> +12C", "color": "#67000d" } ] } -} \ No newline at end of file +} diff --git a/frontend/src/config/southsudan/layers.json b/frontend/src/config/southsudan/layers.json index 402b79db3..82379a015 100644 --- a/frontend/src/config/southsudan/layers.json +++ b/frontend/src/config/southsudan/layers.json @@ -3,14 +3,8 @@ "type": "boundary", "path": "data/southsudan/ssd_admbnda_adm2_imwg_nbs_20180817.json", "admin_code": "ADM2_PCODE", - "admin_level_names": [ - "ADM1_EN", - "ADM2_EN" - ], - "admin_level_local_names": [ - "ADM1_EN", - "ADM2_EN" - ], + "admin_level_names": ["ADM1_EN", "ADM2_EN"], + "admin_level_local_names": ["ADM1_EN", "ADM2_EN"], "opacity": 0.8, "styles:": { "fill": { @@ -27,12 +21,8 @@ "type": "boundary", "path": "data/southsudan/ssd_admbnda_adm1_imwg_nbs_20210924.json", "admin_code": "ADM1_PCODE", - "admin_level_names": [ - "ADM1_EN" - ], - "admin_level_local_names": [ - "ADM1_EN" - ], + "admin_level_names": ["ADM1_EN"], + "admin_level_local_names": ["ADM1_EN"], "opacity": 0.8, "styles:": { "fill": { @@ -167,8 +157,9 @@ }, "chart_data": { "fields": [ - { "key": "rfq", - "label": "Rainfall anomaly", + { + "key": "rfq", + "label": "Rainfall anomaly", "color": "#375692", "minValue": 0, "maxValue": 300 @@ -394,11 +385,13 @@ }, "chart_data": { "fields": [ - { "key": "r1q", + { + "key": "r1q", "label": "Rainfall anomaly", "minValue": 0, - "maxValue": 300, - "color": "#375692" }, + "maxValue": 300, + "color": "#375692" + }, { "key": "rfq_avg", "label": "Normal", @@ -620,11 +613,13 @@ }, "chart_data": { "fields": [ - { "key": "r3q", + { + "key": "r3q", "label": "Rainfall anomaly", "minValue": 0, "maxValue": 300, - "color": "#375692" }, + "color": "#375692" + }, { "key": "rfq_avg", "label": "Normal", @@ -1273,46 +1268,57 @@ "legend_text": "1-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1333,46 +1339,57 @@ "legend_text": "3-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1393,46 +1410,57 @@ "legend_text": "6-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1453,46 +1481,57 @@ "legend_text": "9-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1513,46 +1552,57 @@ "legend_text": "1-year Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -2277,11 +2327,13 @@ }, "chart_data": { "fields": [ - { "key": "viq", - "label": "NDVI anomaly", + { + "key": "viq", + "label": "NDVI anomaly", "minValue": 0, "maxValue": 150, - "color": "#5e803f" }, + "color": "#5e803f" + }, { "key": "viq_avg", "label": "Normal", @@ -2888,10 +2940,7 @@ "title": "Flood events over time", "type": "static_raster", "base_url": "http://prism-raster-tiles.s3-website-us-east-1.amazonaws.com/ssd-flood-events/test/{YYYY_MM_DD}/{z}/{x}/{y}.png", - "dates": [ - "2022-12-01", - "2022-12-11" - ], + "dates": ["2022-12-01", "2022-12-11"], "opacity": 1.0, "legend_text": "Flood events", "min_zoom": 0, @@ -3040,10 +3089,7 @@ "opacity": 1, "legend_text": "Types of armed conflict incident. Provided by ACLED (Armed Conflict Location & Event Data Project): https://acleddata.com/", "legend": [ - { "label": "Battles", - "value": "Battles ", - "color": "#ea5545" - }, + { "label": "Battles", "value": "Battles ", "color": "#ea5545" }, { "label": "Explosions/Remote violence", "value": "Explosions/Remote violence", @@ -3093,4 +3139,4 @@ } } } -} \ No newline at end of file +} diff --git a/frontend/src/config/srilanka/layers.json b/frontend/src/config/srilanka/layers.json index 272644ebb..24e299d60 100644 --- a/frontend/src/config/srilanka/layers.json +++ b/frontend/src/config/srilanka/layers.json @@ -111,12 +111,13 @@ }, "chart_data": { "fields": [ - { - "key": "rfq", - "label": "Rainfall anomaly", + { + "key": "rfq", + "label": "Rainfall anomaly", "minValue": 0, "maxValue": 300, - "color": "#375692" }, + "color": "#375692" + }, { "key": "rfq_avg", "label": "Normal", @@ -218,12 +219,13 @@ }, "chart_data": { "fields": [ - { - "key": "r1q", - "label": "Rainfall anomaly", + { + "key": "r1q", + "label": "Rainfall anomaly", "minValue": 0, "maxValue": 300, - "color": "#375692" }, + "color": "#375692" + }, { "key": "rfq_avg", "label": "Normal", @@ -326,9 +328,9 @@ }, "chart_data": { "fields": [ - { - "key": "r3q", - "label": "Rainfall anomaly", + { + "key": "r3q", + "label": "Rainfall anomaly", "minValue": 0, "maxValue": 300, "color": "#375692" @@ -947,46 +949,57 @@ "legend_text": "1-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1007,46 +1020,57 @@ "legend_text": "3-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1067,46 +1091,57 @@ "legend_text": "6-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1127,46 +1162,57 @@ "legend_text": "9-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1187,46 +1233,57 @@ "legend_text": "1-year Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1502,11 +1559,11 @@ "date_interval": "days", "chart_data": { "fields": [ - { - "key": "viq", + { + "key": "viq", "label": "NDVI anomaly", "minValue": 0, - "maxValue": 150, + "maxValue": 150, "color": "#5e803f" }, { @@ -1898,7 +1955,7 @@ } ], "legend_text": "Proportion of households with inadequate food consumption. CFSAM 2023" - }, + }, "food_expenditure": { "type": "admin_level_data", "title": "Proportion of households spending >75% on food", diff --git a/frontend/src/config/tajikistan/layers.json b/frontend/src/config/tajikistan/layers.json index e6d9b2e59..8f56ee4bf 100644 --- a/frontend/src/config/tajikistan/layers.json +++ b/frontend/src/config/tajikistan/layers.json @@ -380,46 +380,57 @@ "legend_text": "1-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -440,46 +451,57 @@ "legend_text": "3-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -500,46 +522,57 @@ "legend_text": "6-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -560,46 +593,57 @@ "legend_text": "9-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -620,46 +664,57 @@ "legend_text": "1-year Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } diff --git a/frontend/src/config/types.ts b/frontend/src/config/types.ts index 8b457ab52..fd4791279 100644 --- a/frontend/src/config/types.ts +++ b/frontend/src/config/types.ts @@ -420,6 +420,12 @@ export class WMSLayerProps extends CommonLayerProps { @optional chartData?: DatasetProps; // If included, on a click event, prism will display data from the selected boundary. + + @optional + 'areaExposedValues'?: { label: string; value: string | number }[]; + + @optional + 'thresholdValues'?: { label: string; value: string | number }[]; } export class StaticRasterLayerProps extends CommonLayerProps { @@ -495,6 +501,37 @@ export enum AggregationOperations { Median = 'median', Min = 'min', Sum = 'sum', + 'Area exposed' = 'intersect_percentage', +} + +export const units: Partial> = { + intersect_percentage: '%', + stats_intersect_area: 'km²', +}; + +export const aggregationOperationsToDisplay: Record< + AggregationOperations, + string +> = { + [AggregationOperations.Max]: 'Max', + [AggregationOperations.Mean]: 'Mean', + [AggregationOperations.Median]: 'Median', + [AggregationOperations.Min]: 'Min', + [AggregationOperations.Sum]: 'Sum', + [AggregationOperations['Area exposed']]: 'Percent of area exposed', +}; + +export enum ExposureOperator { + LOWER_THAN = '<', + LOWER_THAN_EQUAL = '<=', + EQUAL = '=', + GREATER_THAN = '>', + GREATER_THAN_EQUAL = '>=', +} + +export interface ExposureValue { + operator: ExposureOperator; + value: string; } export enum PolygonalAggregationOperations { @@ -504,7 +541,8 @@ export enum PolygonalAggregationOperations { export type AllAggregationOperations = | AggregationOperations - | PolygonalAggregationOperations; + | PolygonalAggregationOperations + | 'stats_intersect_area'; export type ThresholdDefinition = { below?: number; above?: number }; diff --git a/frontend/src/config/ukraine/layers.json b/frontend/src/config/ukraine/layers.json index b82ec7760..9db802e51 100644 --- a/frontend/src/config/ukraine/layers.json +++ b/frontend/src/config/ukraine/layers.json @@ -4,12 +4,8 @@ "path": "data/ukraine/ukr_admbnda_adm1_sspe_20220114.json", "opacity": 0.8, "admin_code": "adm1_id", - "admin_level_names": [ - "ADM1_EN" - ], - "admin_level_local_names": [ - "ADM1_UA" - ], + "admin_level_names": ["ADM1_EN"], + "admin_level_local_names": ["ADM1_UA"], "styles:": { "fill": { "fill-opacity": 0 @@ -26,14 +22,8 @@ "path": "data/ukraine/ukr_admbnda_adm2_sspe_20220114.json", "opacity": 0.8, "admin_code": "adm2_id", - "admin_level_names": [ - "ADM1_EN", - "ADM2_EN" - ], - "admin_level_local_names": [ - "ADM1_UA", - "ADM2_UA" - ], + "admin_level_names": ["ADM1_EN", "ADM2_EN"], + "admin_level_local_names": ["ADM1_UA", "ADM2_UA"], "styles:": { "fill": { "fill-opacity": 0 @@ -51,7 +41,7 @@ "server_layer_name": "r1q_dekad", "additional_query_params": { "styles": "rfq_14_20_400" - }, + }, "base_url": "https://api.earthobservation.vam.wfp.org/ows/", "date_interval": "days", "opacity": 0.7, @@ -939,46 +929,57 @@ "legend_text": "1-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -999,46 +1000,57 @@ "legend_text": "3-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1059,46 +1071,57 @@ "legend_text": "6-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1119,46 +1142,57 @@ "legend_text": "9-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -1179,49 +1213,60 @@ "legend_text": "1-year Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } ] } -} \ No newline at end of file +} diff --git a/frontend/src/config/zimbabwe/layers.json b/frontend/src/config/zimbabwe/layers.json index 09755ccae..d89120524 100644 --- a/frontend/src/config/zimbabwe/layers.json +++ b/frontend/src/config/zimbabwe/layers.json @@ -50,46 +50,57 @@ "legend_text": "1-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -110,46 +121,57 @@ "legend_text": "3-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -170,46 +192,57 @@ "legend_text": "6-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -230,46 +263,57 @@ "legend_text": "9-month Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -290,46 +334,57 @@ "legend_text": "1-year Standardized Precipitation Index calculated from dekadal CHIRPS data", "legend": [ { + "value": -2.01, "label": "< -2", "color": "#730000" }, { + "value": -2, "label": "-1.5 to -2", "color": "#e70001" }, { + "value": -1.5, "label": "-1.2 to -1.5", "color": "#ffaa01" }, { + "value": -1.2, "label": "-0.7 to -1.2", "color": "#ffd37b" }, { + "value": -0.7, "label": "-0.5 to -0.7", "color": "#ffff02" }, { + "value": -0.5, "label": "0.5 to -0.5 ", "color": "#f0f0f0" }, { + "value": 0.5, "label": "0.5 to 0.7", "color": "#beebff" }, { + "value": 0.7, "label": "0.7 to 1.2", "color": "#73b2ff" }, { + "value": 1.2, "label": "1.2 to 1.5", "color": "#0271ff" }, { + "value": 1.5, "label": "1.5 to 2.0", "color": "#004dad" }, { + "value": 2, "label": "> 2.0", "color": "#ad03e6" } @@ -395,8 +450,9 @@ "date_interval": "days", "chart_data": { "fields": [ - { "key": "rfq", - "label": "Rainfall anomaly", + { + "key": "rfq", + "label": "Rainfall anomaly", "color": "#375692", "minValue": 0, "maxValue": 300 @@ -452,10 +508,7 @@ "chart_data": { "url": "https://api.earthobservation.vam.wfp.org/stats/admin/fetch", "fields": [ - { "key": "rfb", - "label": "Rainfall", - "color": "#233f5f" - }, + { "key": "rfb", "label": "Rainfall", "color": "#233f5f" }, { "key": "rfb_avg", "label": "Average", @@ -509,11 +562,13 @@ "chart_data": { "url": "https://api.earthobservation.vam.wfp.org/stats/admin/fetch", "fields": [ - { "key": "rfq", - "label": "Rainfall anomaly", + { + "key": "rfq", + "label": "Rainfall anomaly", "minValue": 0, "maxValue": 300, - "color": "#375692" }, + "color": "#375692" + }, { "key": "rfq_avg", "label": "Normal", @@ -615,11 +670,13 @@ }, "chart_data": { "fields": [ - { "key": "r1q", + { + "key": "r1q", "label": "Rainfall anomaly", "minValue": 0, - "maxValue": 300, - "color": "#375692" }, + "maxValue": 300, + "color": "#375692" + }, { "key": "rfq_avg", "label": "Normal", @@ -937,11 +994,13 @@ "base_url": "https://api.earthobservation.vam.wfp.org/ows/", "chart_data": { "fields": [ - { "key": "r3q", + { + "key": "r3q", "label": "Rainfall anomaly", "minValue": 0, "maxValue": 300, - "color": "#375692" }, + "color": "#375692" + }, { "key": "rfq_avg", "label": "Normal", @@ -1412,7 +1471,7 @@ "additional_query_params": { "styles": "r6b_blended" }, - "disableAnalysis": true, + "disableAnalysis": true, "base_url": "https://api.earthobservation.vam.wfp.org/ows/", "date_interval": "days", "opacity": 0.7, @@ -1435,7 +1494,7 @@ { "value": 1400, "label": "1400-1600 mm", "color": "#fa78fa" }, { "value": 1600, "label": "> 1600 mm", "color": "#ffc4ee" } ] - }, + }, "precip_blended_9m": { "title": "Blended rainfall aggregate (9-month)", "type": "wms", @@ -1497,7 +1556,7 @@ { "value": 2000, "label": "2000-2400 mm", "color": "#fa78fa" }, { "value": 2400, "label": "> 2400 mm", "color": "#ffc4ee" } ] - }, + }, "precip_blended_anomaly_1m": { "title": "Blended rainfall anomaly (1-month)", "type": "wms", @@ -1671,7 +1730,7 @@ { "value": 170, "label": "170-200%", "color": "#0000c8" }, { "value": 200, "label": "> 200%", "color": "#a002fa" } ] - }, + }, "precip_blended_anomaly_9m": { "title": "Blended rainfall anomaly (9-month)", "type": "wms", @@ -1700,7 +1759,7 @@ { "value": 170, "label": "170-200%", "color": "#0000c8" }, { "value": 200, "label": "> 200%", "color": "#a002fa" } ] - }, + }, "precip_blended_anomaly_1y": { "title": "Blended rainfall anomaly (1-year)", "type": "wms", @@ -1729,7 +1788,7 @@ { "value": 170, "label": "170-200%", "color": "#0000c8" }, { "value": 200, "label": "> 200%", "color": "#a002fa" } ] - }, + }, "days_dry": { "title": "Days since last rain", "type": "wms", @@ -2003,11 +2062,13 @@ }, "chart_data": { "fields": [ - { "key": "viq", - "label": "NDVI anomaly", + { + "key": "viq", + "label": "NDVI anomaly", "minValue": 0, "maxValue": 150, - "color": "#5e803f" }, + "color": "#5e803f" + }, { "key": "viq_avg", "label": "Normal", diff --git a/frontend/src/context/analysisResultStateSlice.ts b/frontend/src/context/analysisResultStateSlice.ts index bf451babf..20f6af550 100644 --- a/frontend/src/context/analysisResultStateSlice.ts +++ b/frontend/src/context/analysisResultStateSlice.ts @@ -21,6 +21,7 @@ import { AsyncReturnType, BoundaryLayerProps, ExposedPopulationDefinition, + ExposureValue, LayerKey, PolygonalAggregationOperations, TableType, @@ -95,7 +96,7 @@ export type TableRow = { baselineValue: DataRecord['value']; coordinates?: Position; } & { - [k in AggregationOperations]?: number; + [k in AggregationOperations]?: number | string; } & { [key: string]: number | string }; // extra columns like wind speed or earthquake magnitude const initialState: AnalysisResultState = { @@ -329,6 +330,7 @@ export type AnalysisDispatchParams = { threshold: ThresholdDefinition; date: ReturnType; // just a hint to developers that we give a date number here, not just any number statistic: AggregationOperations; // we might have to deviate from this if analysis accepts more than what this enum provides + exposureValue: ExposureValue; }; export type PolygonAnalysisDispatchParams = { @@ -358,6 +360,7 @@ const createAPIRequestParams = ( params?: WfsRequestParams | AdminLevelDataLayerProps | BoundaryLayerProps, maskParams?: any, geojsonOut?: boolean, + exposureValue?: ExposureValue, ): ApiData => { // Get default values for groupBy and admin boundary file path at the proper adminLevel const { @@ -396,6 +399,10 @@ const createAPIRequestParams = ( ...maskParams, // TODO - remove the need for the geojson_out parameters. See TODO in zonal_stats.py. geojson_out: Boolean(geojsonOut), + intersect_comparison: + exposureValue?.operator && exposureValue.value + ? `${exposureValue?.operator}${exposureValue?.value}` + : undefined, }; return apiRequest; @@ -587,6 +594,7 @@ export const requestAndStoreAnalysis = createAsyncThunk< extent, statistic, threshold, + exposureValue, } = params; const baselineData = layerDataSelector(baselineLayer.id)( api.getState(), @@ -607,6 +615,9 @@ export const requestAndStoreAnalysis = createAsyncThunk< extent, date, baselineLayer, + undefined, + undefined, + exposureValue, ); const aggregateData = scaleAndFilterAggregateData( @@ -652,8 +663,17 @@ export const requestAndStoreAnalysis = createAsyncThunk< // Create a legend based on statistic data to be used for admin level analsysis. const legend = createLegendFromFeatureArray(features, statistic); + const enrichedStatistics: ( + | AggregationOperations + | 'stats_intersect_area' + )[] = [statistic]; + if (statistic === AggregationOperations['Area exposed']) { + /* eslint-disable-next-line fp/no-mutating-methods */ + enrichedStatistics.push('stats_intersect_area'); + } + const tableRows: TableRow[] = generateTableFromApiData( - [statistic], + enrichedStatistics, aggregateData, adminBoundariesData, apiRequest.group_by, diff --git a/frontend/src/utils/analysis-utils.ts b/frontend/src/utils/analysis-utils.ts index 006b15164..2bf838037 100644 --- a/frontend/src/utils/analysis-utils.ts +++ b/frontend/src/utils/analysis-utils.ts @@ -2,7 +2,6 @@ import { flatten, get, has, - invert, isNull, isNumber, isString, @@ -24,6 +23,7 @@ import { AdminLevelDataLayerProps, AdminLevelType, AggregationOperations, + aggregationOperationsToDisplay, AsyncReturnType, BoundaryLayerProps, ImpactLayerProps, @@ -111,6 +111,11 @@ const operations = { const ceil = sortedValues.length / 2; return (sortedValues[floor] + sortedValues[ceil]) / 2; }, + intersect_percentage: () => { + throw new Error( + 'intersect_percentage calculation is not available from client side', + ); + }, }; const scaleValueIfDefined = ( @@ -556,13 +561,21 @@ export function createLegendFromFeatureArray( // Make sure you don't have a value greater than maxNum. const value = Math.min(breakpoint, maxNum); + /* eslint-disable fp/no-mutation */ + let formattedValue; + if (statistic === AggregationOperations['Area exposed']) { + formattedValue = `${(value * 100).toFixed(2)} %`; + } else { + formattedValue = `(${Math.round(value).toLocaleString('en-US')})`; + } + /* eslint-enable fp/no-mutation */ return { value, color, label: { text: labels[index], - value: `(${Math.round(value).toLocaleString('en-US')})`, + value: formattedValue, }, }; }); @@ -587,6 +600,10 @@ export class ExposedPopulationResult { return this.getTitle(t); }; + getHazardLayer = (): WMSLayerProps => { + return this.getHazardLayer(); + }; + constructor( tableData: TableRow[], featureCollection: FeatureCollection, @@ -663,8 +680,12 @@ export class BaselineLayerResult { getStatTitle(t?: i18nTranslator): string { return t - ? `${t(this.getHazardLayer().title)} (${t(this.statistic)})` - : `${this.getHazardLayer().title} (${this.statistic})`; + ? `${t(this.getHazardLayer().title)} (${t( + aggregationOperationsToDisplay[this.statistic], + )})` + : `${this.getHazardLayer().title} (${ + aggregationOperationsToDisplay[this.statistic] + })`; } getTitle(t?: i18nTranslator): string | undefined { @@ -703,18 +724,29 @@ export function getAnalysisTableColumns( } const { statistic } = analysisResult; - const analysisTableColumns = [ + const analysisTableColumns: Column[] = [ { id: withLocalName ? 'localName' : 'name', label: 'Name', }, { id: statistic, - label: invert(AggregationOperations)[statistic], // invert maps from computer name to display name. - format: (value: string | number) => getRoundedData(value as number), + label: aggregationOperationsToDisplay[statistic], + format: (value: string | number) => + getRoundedData(value, undefined, 2, statistic), }, ]; + if (statistic === AggregationOperations['Area exposed']) { + /* eslint-disable-next-line fp/no-mutating-methods */ + analysisTableColumns.push({ + id: 'stats_intersect_area', + label: 'Area exposed in sq km', + format: (value: string | number) => + getRoundedData(value as number, undefined, 2, 'stats_intersect_area'), + }); + } + if (analysisResult instanceof ExposedPopulationResult) { const extraCols = analysisResult?.tableColumns.map((col: string) => ({ id: col, diff --git a/frontend/src/utils/data-utils.ts b/frontend/src/utils/data-utils.ts index 4129cd57d..9add33073 100644 --- a/frontend/src/utils/data-utils.ts +++ b/frontend/src/utils/data-utils.ts @@ -3,23 +3,33 @@ import { TFunction as _TFunction } from 'i18next'; import { isNumber } from 'lodash'; import { TableRowType } from 'context/tableStateSlice'; import { i18nTranslator } from 'i18n'; +import { AggregationOperations, units } from 'config/types'; export type TFunction = _TFunction; export function getRoundedData( data: number | string | null, t?: i18nTranslator, - decimals: number = 3, + decimals: number = 2, + statistic?: AggregationOperations | string, ): string { - if (isNumber(data) && Number.isNaN(data)) { + /* eslint-disable fp/no-mutation */ + let result = data; + if (isNumber(result) && Number.isNaN(result)) { return '-'; } - if (isNumber(data)) { - return parseFloat(data.toFixed(decimals)).toLocaleString(); + if (statistic === AggregationOperations['Area exposed']) { + result = 100 * (Number(result) || 0); } - // TODO - investigate why we received string 'null' values in data. - const dataString = data && data !== 'null' ? data : 'No Data'; - return t ? t(dataString) : dataString; + if (isNumber(result)) { + result = parseFloat(result.toFixed(decimals)).toLocaleString(); + } else { + // TODO - investigate why we received string 'null' values in data. + result = result && result !== 'null' ? result : 'No Data'; + /* eslint-enable fp/no-mutation */ + } + const unit = statistic && units[statistic]; + return `${t ? t(result) : result} ${unit || ''}`; } export function getTableCellVal(