Extract nodata values from metadata when possible

This commit is contained in:
Tim Schaub
2021-08-19 10:40:59 -06:00
parent 8954f001fa
commit 42970915ea
6 changed files with 59 additions and 12 deletions

View File

@@ -59,7 +59,7 @@ const map = new Map({
],
view: new View({
center: [1900000, 6100000],
zoom: 15,
zoom: 13,
minZoom: 10,
}),
});

View File

@@ -80,13 +80,11 @@ const map = new Map({
{
// visible red, band 1 in the style expression above
url: 'https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/2020/S2A_36QWD_20200701_0_L2A/B04.tif',
nodata: 0,
max: 10000,
},
{
// near infrared, band 2 in the style expression above
url: 'https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/2020/S2A_36QWD_20200701_0_L2A/B08.tif',
nodata: 0,
max: 10000,
},
],

View File

@@ -4,8 +4,7 @@ title: Cloud Optimized GeoTIFF (COG)
shortdesc: Rendering a COG as a tiled layer.
docs: >
Tiled data from a Cloud Optimized GeoTIFF (COG) can be rendered as a layer. In this
example, a single 3-band GeoTIFF is used to render RGB data. The `nodata` property is
used to avoid rendering pixels where all three bands are 0.
example, a single 3-band GeoTIFF is used to render RGB data.
tags: "cog"
---
<div id="map" class="map"></div>

View File

@@ -26,7 +26,6 @@ const map = new Map({
sources: [
{
url: 'https://sentinel-cogs.s3.us-west-2.amazonaws.com/sentinel-s2-l2a-cogs/2020/S2A_36QWD_20200701_0_L2A/TCI.tif',
nodata: 0,
},
],
}),