Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Mount Baker's bright ice, computed in your browser

An experiment with deck.gl-raster and Sentinel-2

At the Cloud-Native Geospatial Forum this month, Kyle Barron of Development Seed showed deck.gl-raster: satellite images read straight from cloud storage into the browser and coloured on the graphics card, with no tile server in between. I wanted to try it on something I know, so I gave it the test I use for glaciers on whatcom.land.

The test is simple. Ice and snow are bright in red light and dark in shortwave infrared; rock is not. Where red divided by shortwave infrared is above 2, call it ice. Here the graphics card does that division for every pixel, so you can drag the threshold and watch the answer change.

Figure 1:White: pixels where red / shortwave infrared is above the threshold, on the chosen date. Purple lines: the glaciers as Portland State mapped them in 2015. Images: Sentinel-2, read from the public archive on AWS as you look.

What I noticed

What did not work

The 2015 image, the baseline, is not here. The only public copy that a browser can read is on Microsoft’s Planetary Computer, which stores Sentinel-2 bands as 15-bit numbers. deck.gl-raster reads 16-bit, so for now 2015 shows only as the outlines.

The first version was slow: each view streamed about 22 MB and took half a minute on my connection. Two fixes brought it to about 7 MB. The page now fetches only the two bands the test uses, red and shortwave infrared, so the background is the red band in grey rather than natural colour. And deck.gl-raster 0.8.1 fetched each shortwave-infrared block up to four times over: where two bands share a grid, a tile’s edge lands exactly on the next block’s edge, and the library counted that block too. The patch is one line (maps-src/baker-s2/patch-tile-range.mjs). After the first year, the others load in the background and switching is instant.

Sources

References
  1. Fountain, A., & Glenn, B. (2022). Data From: Inventory of Glaciers and Perennial Snowfields of the Coterminous USA. Portland State University Library. 10.15760/geology-data.03
  2. GLIMS Consortium, Raup, B. H., Racoviteanu, A., Khalsa, S. S., Helm, C., Armstrong, R., & Arnaud, Y. (2005). GLIMS Glacier Database (NSIDC-0272, Version 1). NASA National Snow and Ice Data Center Distributed Active Archive Center. 10.7265/N5V98602