SAEON / somisana

SOMISANA-related tooling
MIT License
6 stars 2 forks source link

[Web] Home page maps broken #48

Open zachsa opened 3 weeks ago

zachsa commented 3 weeks ago

I had a look at why the home page maps stopped rendering. It looks like the WMS service was switched off in favor of a WMTS service. So in the React code:

This:

const SERVICE_URL = `https://nrt.cmems-du.eu/thredds/wms/cmems_mod_glo_phy-thetao_anfc_0.083deg_P1D-m?request=GetCapabilities&service=WMS`

const TILE_URL = `https://nrt.cmems-du.eu/thredds/wms/cmems_mod_glo_phy-thetao_anfc_0.083deg_P1D-m?REQUEST=GetMap&VERSION=1.3.0&LAYERS=thetao&STYLES=${STYLE}&BBOX={bbox-epsg-3857}&CRS=EPSG:3857&WIDTH=256&HEIGHT=256&FORMAT=image/png&transparent=true&COLORSCALERANGE=${minMax}&NUMCOLORBANDS=${thresholds}`

const LEGEND_URL = `https://nrt.cmems-du.eu/thredds/wms/cmems_mod_glo_phy-thetao_anfc_0.083deg_P1D-m?REQUEST=GetLegendGraphic&LAYER=thetao&PALETTE=${PALETTE}&transparent=true&FORMAT=image/png&COLORSCALERANGE=${minMax}&NUMCOLORBANDS=${thresholds}`

Would need to be come this:

const SERVICE_URL = `https://wmts.marine.copernicus.eu/teroWmts/GLOBAL_ANALYSISFORECAST_PHY_001_024/cmems_mod_glo_phy-thetao_anfc_0.083deg_P1D-m_202406?request=GetCapabilities&service=WMTS`;

const TILE_URL = `https://wmts.marine.copernicus.eu/teroWmts?SERVICE=WMTS&REQUEST=GetTile&VERSION=1.0.0&LAYER=GLOBAL_ANALYSISFORECAST_PHY_001_024/cmems_mod_glo_phy-thetao_anfc_0.083deg_P1D-m_202406/thetao&STYLE=${STYLE}&FORMAT=image/png&TILEMATRIXSET=EPSG:3857&TILEMATRIX={z}&TILEROW={y}&TILECOL={x}&COLORSCALERANGE=${minMax}&NUMCOLORBANDS=${thresholds}`;

const LEGEND_URL = `https://wmts.marine.copernicus.eu/teroWmts?REQUEST=GetLegendGraphic&LAYER=GLOBAL_ANALYSISFORECAST_PHY_001_024/cmems_mod_glo_phy-thetao_anfc_0.083deg_P1D-m_202406/thetao&STYLE=${STYLE}&PALETTE=${PALETTE}&transparent=true&FORMAT=image/png&COLORSCALERANGE=${minMax}&NUMCOLORBANDS=${thresholds}`;

More or less. I tested it - it works, but the legend would need to be redone / removed. Also not sure if the color range and scheme is the same.

Might just be easier to remove the Home page CMEMS maps. You can do this by commenting out the CMEMS WMS layer:

import Div from '../../../components/div'
import MapProvider from './_map-context'
import SaeonModels from './_saeon-models'
import MarineProtectedAreasLayer from './layers/marine-protected-areas'
// import CmemsWMSLayer from './layers/cmems-wms'
import DomainsLayer from './layers/domains'
import CoordinatesLayer from './layers/coordinates'

export default ({ container }) => {
  return (
    container && (
      <Div>
        <MapProvider container={container}>
          <MarineProtectedAreasLayer />
          {/* <CmemsWMSLayer /> */}
          <DomainsLayer />
          <SaeonModels />
          <CoordinatesLayer />
        </MapProvider>
      </Div>
    )
  )
}
zachsa commented 3 weeks ago

I think @Marc-Pienaar is doing React these days.

GilesFearon commented 3 weeks ago

Thanks Zach Our new developer working on OCIMS, Dylan Pivo, will be looking into resurrecting your visualisation work soon, with hopefully quite a bit of time dedicated next year. So this work will be picked up again soon