bhuvan_raster: Download Bhuvan NTL raster tiles for a region

View source: R/download_bhuvan.R

bhuvan_rasterR Documentation

Download Bhuvan NTL raster tiles for a region

Description

Fetches annual nighttime lights GeoTIFF tiles from the Bhuvan WMS service for a given spatial extent and converts the classed RGB map to a single-band radiance raster.

Usage

bhuvan_raster(
  region,
  years,
  force = FALSE,
  width = 1024,
  height = 1024,
  bbox_pad = c(0, 0, 0, 0)
)

Arguments

region

An sf object, SpatVector, or ISO 3166-1 alpha-3 country code (e.g., "IND"). Used to derive the WMS bounding box.

years

Integer vector of years to download (2012-2024).

force

Logical. If TRUE, re-download even if cached. Default FALSE.

width, height

Pixel dimensions of the WMS request. Default 1024x1024.

bbox_pad

Numeric vector of length 1 or 4 (xmin, ymin, xmax, ymax sides) in degrees, added to the region bounding box before the WMS request. Useful when GADM boundaries clip disputed territories (e.g. bbox_pad = c(0, 0, 0, 3.5) extends the north edge by 3.5 degrees to include all of Jammu and Kashmir).

Details

The Bhuvan WMS does not serve continuous radiance. It returns a map with four colour classes, which are converted to representative radiance values in nW/cm^2/sr:

Colour Class Value
black < 5 2.5
blue-grey 5 - 25 15
cream 26 - 200 112.5
red > 200 200

The first three values are class midpoints; the open-ended top class is set to its floor, so the brightest areas are underestimated. Pixels that match no class (the portal's watermark and its anti-aliased edges) are NA. Treat the output as coarse, banded radiance: use VIIRS from ntl_download() when you need continuous calibrated values.

Value

A named list of single-band SpatRaster objects, keyed by year (e.g., list("2020" = rast(...), "2021" = rast(...))). Errors if the WMS fetch fails for any requested year.

Collection break

Bhuvan NTL data from 2024 onwards is derived from VNP46A4 Collection 2.0, while 2012-2023 uses the legacy Collection 1.0. The two collections use different calibration and atmospheric correction algorithms, so values are not directly comparable across this boundary.

Examples


states <- get_india_admin("state")
rasters <- bhuvan_raster(states, years = 2021:2022)
panel <- extract_panel(rasters, states, id_col = "state_name")


lightson documentation built on Nov. 3, 2026, 5:07 p.m.