The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

India electrification trends with VIIRS

Get a NASA Earthdata token

  1. Register at https://urs.earthdata.nasa.gov/
  2. Go to Profile → Generate Token
  3. Sys.setenv(EARTHDATA_TOKEN = "YOUR_TOKEN"), or pass the token directly to earthdata_token("TOKEN")

Tiles are cached in tools::R_user_dir("lightson", "cache") after the first download; cache_clear() removes them.

Quick workflow

library(lightson)

token <- earthdata_token()
rasters <- ntl_download(region = "IND", years = 2015:2025, token = token)
districts <- get_india_admin(level = "district")
panel <- extract_panel(rasters, districts)
plot_ntl_trend(panel, region = "Lucknow")

Use your own shape/boundary file

extract_panel() accepts any sf object:

library(sf)
my_districts <- sf::read_sf("~/github/bharatviz/public/India_LGD_districts.geojson")
panel2 <- extract_panel(rasters, my_districts, id_col = "district_name")

See the Custom geometry vignette for a complete walkthrough using bharatviz boundaries with Bhuvan NTL rasters, which need only ISRO’s public API.

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.