Tools to Work with the 'India Lights' 'API'
The 'India Lights' 'API' shows light output at night for 20 years, from 1993 to 2013, for 600,000 villages across India. The 'Defense Meteorological Satellite Program' ('DMSP'), run by the 'U.S.' 'Department of Defense', has taken pictures of the Earth every night for 20 years. Researchers at the 'University of Michigan' used the 'DMSP' images to extract the data and provide it in tabular form. The 'India Lights' 'API' provides the data at convenient endpoints that allows you to look at specific time intervals and administration levels. Tools are provided to query these 'API' endpoints.
The following functions are implemented:
ial_district
: Time series for a single districtial_districts
: Time series for all districts in a stateial_regions
: List of all the regions (districts) with display name and idial_state
: Time series for a single stateial_states
: Time series for all states in the nationial_villages
: Time series for comma separated list of villagesdevtools::install_git("https://gitlab.com/hrbrmstr/indialights.git")
options(width=120)
library(indialights) library(tidyverse) # current verison packageVersion("indialights")
Time series for a single district:
ial_district("gujarat-anand", "1993.3", "1993.4")
Time series for all districts in a state:
ial_state( state_id = "gujarat", interval_start = "1993.3", interval_stop = "1993.4" )
List of all the regions (districts) with display name and id:
NOTE THIS ENDPOINT ON THEIR SERVER IS BROKEN
ial_regions()
Time series for all states in the nation:
ial_states( interval_start = "1993-03-01", interval_stop = "1993-04-01" )
Time series for the given state:
ial_state( state_id = "gujarat", interval_start = as.Date("1993-03-01"), interval_stop = as.Date("1993-04-01") )
Time series for comma separated list of villages:
ial_villages( village_ids = c("104000100132900", "104000200153500", "108000200308200"), interval_start = "1993.3", interval_stop = "1993.4" )
Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.