Check if a vector/list of values given is valid as per the given validation function
Initiates the country nightlight dataframe with the country data read from the polygon
Download VIIRS nightlight tile
Check if VIIRS nightlight stats exist locally
Check if a month number is valid for a given nightlight type
Get the full path to the file containing the country data
Gets the root path to the file directory"
Get the paths to the various data locations
Returns the directory name of the unzipped shapefile downloaded from GADM.ORG without the path
Get the path of the unzipped polygon directory downloaded from GADM.ORG
Calculate zonal statistics. Used internally
Clean up the environment after processing (Not yet implemented)
Create required data subdirectories in the root data path
Creates a tile Spatial Polygons DataFrame from the "nlTiles"
dataframe
Check if the compressed country polygon has been downloaded and stored in the polygon folder
Run a web application to explore the processed nightlight data cached locally
Save a data frame of a country's data to the appropriate location
Sets the root path to the package data directory
Get the index of a tile given its name
tilesPolygonIntersectVIIRS
Get the list of VIIRS tiles that a polygon intersects with
Create a zonal file if it does not exist and calculate the zonal stats
Add README file to the root data path
Calculate zonal statistics using GDAL. Faster than fnAggRadRast for large polygons.
Convert a country ISO3 code to the full name
Convert a country name to its ISO3 code
Download the listed tiles for a given nlType in a given nlPeriod
Get the list of admin level names in a polygon shapefile
Get the GADM url from which to download country polygons
Constructs the filename used to save/access the decompressed OLS .tif file
Constructs the filename of the decompressed OLS .tif file
Function to return the url of the OLS tile to download
Function to return the url of the VIIRS tile to download
mapAllCtryPolyToTilesVIIRS
Create a mapping of all countries and the tiles they intersect
Create a mapping of all countries and the tiles they intersect
Initialize some important variables and create directory structure
Create a range of nlPeriods
Calculate statistics on a nightlight raster that fall within a polygon
Get the full path to the file where the cropped VIIRS country raster is stored.
Get the name of the lowest ctry admin level
Get the standard name of a polygon layer for a country
Returns a list of VIIRS nightlight tiles that a country or countries
intersects with
Check if an OLS nlYear is valid
Check if a VIIRS nlYearMonth is valid
The name with which to save the OLS tile locally
Constructs the full path used to save/access the compressed downloaded tile
Extract raster pixel values within the boundaries of a polygon
extract data from a raster using one polygon in a multipolygon
Download OLS nightlight tile
Check if a month number is valid for a given nightlight type
Generate a list of all possible nlPeriods for a given nlType
Constructs the full path used to save/access the downloaded tile .tgz file
getNlTileTifLclNamePathOLS
Constructs the full path used to save/access the decompressed OLS .tif file
Get the filename of the polygon zip file as downloaded from http://www.GADM.ORG getTilesCtryIntersectVIIRS
Get a list of tiles that a country polygon intersects with
Insert an aggregate nightlight data column in a country nightlights dataframe
List available data
Set or get options for the Rnightlights package
Reset global options for the Rnightlights package
Check if a month number is valid for a given nightlight type
Check if a country dataframe is valid
Plot a country polygon against a background of the VIIRS tiles and world map
Processes nightlights for an individual country in a particular nlPeriod
Interactively allows the user to set up the default root path
Get the name of a tile given its index
Check if a tile index name is valid for a given nightlight type
Check if a tile index number is valid for a given nightlight type
Get the integer number of the layer. topmost country layer=0
Download a country's polygon shapefile from http://gadm.org Check if a country's data file exists
Check if the decompressed country polygon has been downloaded and stored in the polygon folder
Returns nightlight statistics for the given ctryCode and nlType in the given nPeriods
Construct the name of a nightlight data column given the nightlight type and nlPeriod
getNlTileTifLclNamePathVIIRS
Constructs the full path used to save/access the decompressed VIIRS .tif file
Constructs the filename of the decompressed VIIRS .tif file
Constructs the filename used to save/access the downloaded VIIRS tile .tgz file
Create mapping of nightlight tiles
List available cropped country rasters
List locally cached tiles
Downloads nightlight tiles and country polygons and calls the function to process them
Deletes a root data path all sub-directories
Check if a month number is valid for a given nightlight type
Check if an nlPeriod is valid for a given nightlight type
Check if a year is valid for a given nightlight type
Check if a statistic given is valid