Climate layers

Three open climate data sets as map tiles on this host: solar irradiance, last year’s temperature anomaly and river flood depth for a 100-year flood. The climate showcase draws them with a legend, an opacity slider and the values for any place you select.

A demo with public data: it is not a risk assessment and says nothing about any Siemens site.

The layers

LayerUnitSource
solarkWh/m² per day, long-term averageGlobal Solar Atlas 2.0, World Bank Group, data by Solargis, CC BY 4.0
temperature°C against 1951 to 1980, last full yearNASA GISS Surface Temperature Analysis (GISTEMP v4)
floodm, 100-year river flood© European Union, JRC global flood hazard maps (Joint Research Centre), CC BY 4.0

How the tiles carry values

  • Each layer is one PMTiles archive below /data/climate/, named in /data/climate/current.json with its maximum zoom, unit and credit.
  • A tile is a lossless 512 px image. Its red and green channels hold value × 10 in the Terrarium encoding: red × 256 + green − 32768. Black is no data.
  • So one archive serves both light and dark maps: the colors are chosen in the page, and a click reads the exact number from the same tile.
  • The sources were reprojected to the web map grid, resampled and rounded to one decimal. Show the credit of every layer you draw.

On a page of this site

The archives are served to pages on this host. A layer on your own MapLibre map:

HTML
<div id="map" style="height: 480px"></div>
<script type="module">
  // On a page of this host: MapLibre GL JS and the PMTiles protocol, bundled with your page.
  import { Map, addProtocol } from 'maplibre-gl';
  import { Protocol } from 'pmtiles';
  addProtocol('pmtiles', new Protocol().tile);

  // The pointer names the current archive of every layer.
  const { layers } = await (await fetch('/data/climate/current.json')).json();
  const map = new Map({ container: 'map', style: '/your-basemap-style.json', center: [10, 30], zoom: 1.5 });
  map.on('load', () => {
    map.addSource('solar', { type: 'raster-dem', url: 'pmtiles://' + location.origin + layers.solar.url, encoding: 'terrarium', tileSize: 512 });
    map.addLayer({
      id: 'solar', type: 'color-relief', source: 'solar',
      paint: {
        'color-relief-opacity': 0.8,
        // Heights are value * 10: 45 means 4.5 kWh/m² per day. -32768 is no data.
        'color-relief-color': ['interpolate', ['linear'], ['elevation'],
          -32768, 'rgba(0, 0, 0, 0)', -32767, '#FFF4CC',
          10, '#FFF4CC', 30, '#FFD35C', 45, '#F5A300', 55, '#D46A00', 65, '#8F3A00'],
      },
    });
  });
</script>