Published
Edited
Oct 10, 2021
1 fork
2 stars
Insert cell
md`# Calculate Normalized Difference Vegetation Index (NDVI)

Equation:

![ndvi](https://wikimedia.org/api/rest_v1/media/math/render/svg/6e8f5257f485c39659111ddc8b81452984e6278f)

Source: https://en.wikipedia.org/wiki/Normalized_difference_vegetation_index
`
Insert cell
geoblaze = require('geoblaze')
Insert cell
georaster = geoblaze.load('https://s3.amazonaws.com/geoblaze/color_infrared_dir_st_louis.tif')
Insert cell
georaster.toCanvas({ width: 500, height: 500 })
Insert cell
ndvi = geoblaze.bandArithmetic(georaster, '(a - b) / (a + b)');
Insert cell
ndvi.toCanvas({ width: 500, height: 500 })
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more