Learn R Programming

Rnightlights (version 0.2.4)

mapCtryPolyToTilesVIIRS: Create a mapping of all countries and the tiles they intersect

Description

Create a dataframe mapping each country in the rworldmap to the VIIRS tiles which they intersect with and thus need to be retrieved to process their nightlight imagery. Since some functions use this dataframe for long-term processing, omitCountries can eliminate countries that should be excluded from the list hence from processing. Countries can be added in the omitCountries function. Default is "none".

Usage

mapCtryPolyToTilesVIIRS(ctryCodes = "all",
  omitCountries = pkgOptions("omitCountries"))

Arguments

ctryCodes

A character vector or list of countries to map. Default is "all"

omitCountries

A character vector or list of countries to leave out. Default is "none"

Value

ctryCodeTiles A data frame of countries and the tiles they intersect with as give by getNlTiles

Examples

Run this code
# NOT RUN {
#map all countries
# }
# NOT RUN {
tileMap <- Rnightlights:::mapCtryPolyToTilesVIIRS()
# }
# NOT RUN {
#map all countries, no countries omitted
# }
# NOT RUN {
tileMap <- Rnightlights:::mapCtryPolyToTilesVIIRS(ctryCodes="all", omitCountries="none")
# }
# NOT RUN {
#will not omit countries that do not have polygons on GADM
# }
# NOT RUN {
tileMap <- Rnightlights:::mapCtryPolyToTilesVIIRS(omitCountries=c("error", "missing"))
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab