Skip to content

Commit

Permalink
chore: adapt the appConfig for polar
Browse files Browse the repository at this point in the history
  • Loading branch information
lubojr committed Feb 13, 2024
1 parent 36dab33 commit 070d15e
Show file tree
Hide file tree
Showing 3 changed files with 131 additions and 20 deletions.
46 changes: 44 additions & 2 deletions app/src/appConfig.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,49 @@ module.exports = [
demoMode: {
polartep: [
{
poi: 'World-TOPAZ5_SIAGE',
poi: 'World-TOPAZ5_P1D_SIAGE',
},
{
poi: 'World-TOPAZ5_P1D_SICONC',
},
{
poi: 'World-TOPAZ5_P1D_SISNTHICK',
},
{
poi: 'World-TOPAZ5_P1D_SITHICK',
},
{
poi: 'World-TOPAZ5_P1D_VXO',
},
{
poi: 'World-TOPAZ5_P1D_VXSI',
},
{
poi: 'World-TOPAZ5_P1D_VYO',
},
{
poi: 'World-TOPAZ5_P1D_VYSI',
},
{
poi: 'World-TOPAZ4_P1D_SICONC',
},
{
poi: 'World-TOPAZ4_P1D_SISNTHICK',
},
{
poi: 'World-TOPAZ4_P1D_SITHICK',
},
{
poi: 'World-TOPAZ4_P1D_VXO',
},
{
poi: 'World-TOPAZ4_P1D_VXSI',
},
{
poi: 'World-TOPAZ4_P1D_VYO',
},
{
poi: 'World-TOPAZ4_P1D_VYSI',
},
{
poi: 'World-SITI',
Expand Down Expand Up @@ -415,7 +457,7 @@ module.exports = [
},
],
},
match: ['polardashboard.org', 'polar.eox.world', 'polar.localhost', 'polar.eox.home', 'eodash-polar.eox.at', 'eodash-polar-staging.eox.at', 'eodash-polar-testing.eox.at'],
match: ['polardashboard.org', 'polar.eox.world', 'polar.localhost', 'polar.eox.home', 'eodash-polar.eox.at', 'eodash-polar-testing.eox.at'],
branding: {
appName: 'Polar Dashboard',
primaryColor: '#003247',
Expand Down
15 changes: 10 additions & 5 deletions app/src/components/IndicatorFiltersDemo.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div
class="fill-height d-flex flex-column pa-3"
style="height: calc(var(--vh, 1vh) * 100); z-index: 11; pointer-events: all"
class="fill-height d-flex flex-column pa-0"
style="z-index: 11; pointer-events: all"
>
<v-btn
color="primary"
Expand All @@ -28,9 +28,7 @@
<v-img
height="100"
class="flex-shrink-1"
:src="`./data/${appConfig.id}/globalDataLayerImages/${getLocationCode(
demoItem
)}.png`"
:src="getThumbnailImage(demoItem)"
>
</v-img>
<v-card-title
Expand Down Expand Up @@ -171,6 +169,13 @@ export default {
// this is very fragile, we should use events or "iframe" commands
this.centerMapVueComponent.resetView();
},
getThumbnailImage(demoItem) {
// try out the thumbnail from STAC link
// fallback
let url = `./data/${appConfig.id}/globalDataLayerImages/${getLocationCode(demoItem)}.png`;
return url;
},
scroll(direction) {
const scrollElement = this.$refs.scrollContainer;
switch (direction) {
Expand Down
90 changes: 77 additions & 13 deletions app/src/config/polar.js
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,17 @@ const polarStereographicProjection = {
extent: [-3314763.31, -3314763.31, 3314763.31, 3314763.31],
};

const polarStereographicProjectionSH = {
name: 'EPSG:3413',
def: '+proj=stere +lat_0=90 +lat_ts=70 +lon_0=-45 +x_0=0 +y_0=0 +datum=WGS84 +units=m +no_defs +type=crs',
extent: [-3314693.24, -3314693.24, 3314693.24, 3314693.24],
};

const polarStereoDatasetsConfigs = {
baseLayers: arcticBaseMaps,
overlayLayers: arcticOverlayMaps,
mapProjection: polarStereographicProjection,
projection: 'EPSG:4326',
};

export const defaultLayersDisplay = {
Expand All @@ -95,12 +102,33 @@ export const defaultLayersDisplay = {
transparent: true,
tileSize: 512,
opacity: 1,
attribution: '{ <a href="https://race.esa.int/terms_and_conditions" target="_blank">Use of this data is subject to Articles 3 and 8 of the Terms and Conditions</a> }',
attribution: '{ <a href="https://polardashboard.org/terms_and_conditions" target="_blank">Use of this data is subject to Articles 3 and 8 of the Terms and Conditions</a> }',
visible: true,
mapProjection: 'EPSG:3857',
projection: 'EPSG:3857',
};

function createTOPAZ5Config(indicatorCode) {
const config = {
properties: {
indicatorObject: {
indicator: indicatorCode,
display: {
...polarStereoDatasetsConfigs,
}
},
},
};
return config;
}

function createTOPAZ4Config(indicatorCode) {
const config = createTOPAZ5Config(indicatorCode);
config.properties.indicatorObject.time = getDailyDates('1991-01-01', '2022-12-31');
return config;
}


export const excludeMapTimes = {
};

Expand Down Expand Up @@ -222,39 +250,75 @@ export const globalIndicators = [
{
properties: {
indicatorObject: {
indicator: 'SITI',
indicator: 'CDS1_temperature',
display: {
url: 'https://staging-raster.delta-backend.com/cog/tiles/WGS1984Quad/{z-1}/{x}/{y}?&resampling_method=nearest&bidx=1&colormap_name=plasma&rescale=0.0,4.0&{time}',
projection: 'EPSG:4326',
...polarStereoDatasetsConfigs,
projection: polarStereographicProjectionSH,
},
},
},
},
{
properties: {
indicatorObject: {
indicator: 'N12_1_sea_ice_concentration_arctic',
time: getDailyDates('1978-11-01', '2023-12-31'),
indicator: 'CDS3',
display: {
baseLayers: arcticBaseMaps,
overlayLayers: arcticOverlayMaps,
dateFormatFunction: (date) => DateTime.fromISO(date).toFormat("yyyy-MM-dd'T11:59:30.000Z'"),
projection: 'EPSG:3411',
mapProjection: polarStereographicProjection,
...polarStereoDatasetsConfigs,
projection: polarStereographicProjectionSH,
},
},
},
},
{
properties: {
indicatorObject: {
indicator: 'TOPAZ5_SIAGE',
indicator: 'CDS4',
display: {
projection: 'EPSG:4326',
...polarStereoDatasetsConfigs,
projection: polarStereographicProjectionSH,
},
},
},
},
{
properties: {
indicatorObject: {
indicator: 'SITI',
display: {
url: 'https://staging-raster.delta-backend.com/cog/tiles/WGS1984Quad/{z-1}/{x}/{y}?&resampling_method=nearest&bidx=1&colormap_name=plasma&rescale=0.0,4.0&{time}',
...polarStereoDatasetsConfigs,
},
},
},
},
{
properties: {
indicatorObject: {
indicator: 'N12_1_sea_ice_concentration_arctic',
time: getDailyDates('1978-11-01', '2023-12-31'),
display: {
baseLayers: arcticBaseMaps,
overlayLayers: arcticOverlayMaps,
dateFormatFunction: (date) => DateTime.fromISO(date).toFormat("yyyy-MM-dd'T11:59:30.000Z'"),
projection: 'EPSG:3411',
mapProjection: polarStereographicProjection,
},
},
},
},
createTOPAZ4Config('TOPAZ4_P1D_SICONC'),
createTOPAZ4Config('TOPAZ4_P1D_SISNTHICK'),
createTOPAZ4Config('TOPAZ4_P1D_SITHICK'),
createTOPAZ4Config('TOPAZ4_P1D_VXO'),
createTOPAZ4Config('TOPAZ4_P1D_VXSI'),
createTOPAZ4Config('TOPAZ4_P1D_VYO'),
createTOPAZ4Config('TOPAZ4_P1D_VYSI'),
createTOPAZ5Config('TOPAZ5_P1D_SIAGE'),
createTOPAZ5Config('TOPAZ5_P1D_SICONC'),
createTOPAZ5Config('TOPAZ5_P1D_SISNTHICK'),
createTOPAZ5Config('TOPAZ5_P1D_SITHICK'),
createTOPAZ5Config('TOPAZ5_P1D_VXO'),
createTOPAZ5Config('TOPAZ5_P1D_VXSI'),
createTOPAZ5Config('TOPAZ5_P1D_VYO'),
createTOPAZ5Config('TOPAZ5_P1D_VYSI'),
];

0 comments on commit 070d15e

Please sign in to comment.