{"version":"1.0","type":"rich","title":"Gist 6030672","description":"This example computes the Normalized Difference Vegetation Index (NDVI) from red and near-infrared raster bands, then writes the result as a single-band GeoTIFF. It uses the GDAL Python API via `gdal.Open`, `ReadAsArray`, `GetGeoTransform`, and `GetProjectionRef` to read input data and preserve spatial metadata. The calculation applies `np.logical_and` and `np.where` to mask invalid pixels, setting them to -999, while `save_raster` creates the output with LZW compression and tiling. The code handles format selection through a `driver` parameter, defaulting to GeoTIFF.","provider_name":"VizHub AI Studio","provider_url":"https://next.vizhub.com","html":"<iframe src=\"https://next.vizhub.com/viz/gist-6030672?mode=embed\" width=\"960\" height=\"500\" scrolling=\"no\" frameborder=\"1\"></iframe>","width":960,"height":500,"cache_age":3600}