RGBA fetching is out, N band fetching is the new sauce.

Project date Geospatial engineering · Multispectral imagery

A satellite camera doesn’t take one picture. It takes several at once, each in a different slice of light: blue, green, red, and slices our eyes can’t see, like near-infrared. Each slice is called a band. A normal photo is just three of them (red, green and blue, or RGB) shown together.

Up until recently, Sarkoa flattened every uploaded raster down to plain RGB on ingest. It got things working fast, sure, but if you work with satellite imagery you know how painful that is - you’re throwing away most of the data before anyone even opens the map.

Take Sentinel-2: it captures 13 spectral bands (four at 10 m, six at 20 m, and three at 60 m), and a true-colour image only uses three of them. Healthy plants absorb visible red light and bounce back a ton of near-infrared (NASA Earth Observatory’s vegetation guide explains the physics nicely), which is why swapping near-infrared (band 8) into the red display channel makes vegetation jump off the screen. A picture built that way is called false colour: the screen’s red, green and blue are showing bands other than real red, green and blue.

One 5.12 km square in the Dutch bulb-growing region in true colour and near-infrared false colour, with the same patch marked in each view.

Bollenstreek, Netherlands, April 4, 2025. Both views use the same 512 × 512 source window, pixel grid, and reflectance stretch. At the ring, red reflectance is 0.0384 and near infrared is 0.3295, so switching the displayed bands turns that patch red. Contains modified Copernicus Sentinel data (2025). Band values and stretch · Source scene.

Supporting arbitrary band mixes took two changes:

  • The processor now preserves all source bands instead of baking RGB, and reports the band count back to the app.
  • The tiler maps whatever bands you ask for into R, G, and B on the fly at request time.

In the Bollenstreek comparison above, true colour is standard B4, B3, B2, and false colour is B8, B4, B3. Inside the circled patch, near-infrared reflectance is about 8.6× higher than red reflectance (0.3295 vs 0.0384). Same pixels, same date, same stretch - just routing band 8 into the red channel flips that field bright red.

The sneaky part: caching

Actually wiring up dynamic bands was the easy half. The part that can quietly ruin your day is the tile cache.

A cache is a shelf of tiles that have already been drawn, so the same tile never has to be drawn twice. The cache key is the label on each shelf spot: ask for a tile, and if the label matches, you get what’s sitting there.

Tiles are cached by URL path, and previously a tile’s identity was just file / z / x / y (which file, which zoom, which column, which row). Once you can request different band combinations from the same file, that breaks immediately. If you don’t bake the band selection and colour scheme into the cache key, someone viewing false-colour 8-4-3 and someone viewing true-colour 4-3-2 at the exact same zoom and coordinates collide in the cache - and whoever loads second gets handed the wrong image.

Nothing makes a user lose trust in a mapping platform faster than spotless source data showing up in the wrong colours because two viewers poisoned each other’s cache. Putting both the band combo and the colour scheme directly in the cache path keeps every rendering out of everyone else’s way.

All posts