Examples
Sentinel-2 Multi-Band
Sentinel-2 multi-band compositing from separate COGs at different native resolutions. Pixels are sampled per-band and composited on the GPU — no preprocessing, no server.
Installation
$ npx shadcn-vue@latest add https://mapcn-vue.geoql.in/r/map-deckgl-rasterUsage
<script setup lang="ts">
import { VMap } from '@geoql/v-maplibre';
import { VLayerMultiCog } from '@geoql/v-maplibre/geotiff';
import { LinearRescale } from '@developmentseed/deck.gl-raster/gpu-modules';
const base =
'https://sentinel-cogs.s3.us-west-2.amazonaws.com/' +
'sentinel-s2-l2a-cogs/33/S/VB/2024/7/S2B_33SVB_20240725_0_L2A';
const sources = {
red: { url: `${base}/B04.tif` },
green: { url: `${base}/B03.tif` },
blue: { url: `${base}/B02.tif` },
};
const composite = { r: 'red', g: 'green', b: 'blue' };
// Sentinel-2 reflectance is uint16 (DN = reflectance * 10000); the r16unorm
// texture normalization folds it into 0.0 - 0.15, so rescale back to 0 - 1.
const renderPipeline = [
{ module: LinearRescale, props: { rescaleMin: 0, rescaleMax: 0.15 } },
];
</script>
<template>
<VMap :options="mapOptions">
<VLayerMultiCog
id="sentinel2"
:sources="sources"
:composite="composite"
:render-pipeline="renderPipeline"
/>
</VMap>
</template> Components 2
<VMap />@geoql/v-maplibre<VLayerMultiCog />@geoql/v-maplibre/geotiff
Sentinel-2
Each band (B02, B03, B04, B8A, B08, B12) is fetched as a separate Cloud-Optimized GeoTIFF and composited on the GPU.