Public Lab Wiki documentation

NDVI Calculation

1 | 5 | | #62

Plaza San Martin, visible-infrared-NDVI

Good example in GDAL/Python:

Script for GDAL:

Remember, NDVI is:

Infrared - Visible / Infrared + Visible

GDAL commands

Splice out a single band and save as independent geotiff:

gdal_translate -of GTiff -b 2 morflex-freeflight-geo.tif morflex-freeflight-green.tif

On using, I got this error:

nautilus-2:morflex-lima-freeflight warren$ python Traceback (most recent call last): File "", line 31, in var1 = subtract(band4, band3) ValueError: shape mismatch: objects cannot be broadcast to a single shape

Perhaps we can use this GDAL crop script to make both images the same shape: