Get pixel data

This commit is contained in:
Tim Schaub
2022-02-06 16:46:01 -07:00
parent cd45663996
commit eb4d5e0784
23 changed files with 721 additions and 101 deletions

View File

@@ -3,9 +3,12 @@ layout: example.html
title: NDVI from a Sentinel 2 COG
shortdesc: Calculating NDVI and applying a custom color map.
docs: >
The GeoTIFF layer in this example draws from two Sentinel 2 sources: a red band and a near infrared band.
The GeoTIFF layer in this example draws from two Sentinel 2 sources: a red band and a near-infrared band.
The layer style includes a `color` expression that calculates the Normalized Difference Vegetation Index (NDVI)
from values in the two bands. The `interpolate` expression is used to map NDVI values to colors.
The `layer.getData()` method can be used to retrieve pixel values from the GeoTIFF. Move your mouse
or tap on the map to see calculated NDVI values based on the red and near-infrared pixel values.
tags: "cog, ndvi"
---
<div id="map" class="map"></div>
<div>NDVI: <span id="output"></span></div>