Returns URL's of a product/version/resolution
cgls_urls( dates = NULL, resolution = c(1000, 300), product = c("fapar", "fcover", "lai", "ndvi"), ver = c("newest", "v1", "v2", "v3") )
dates | Dates to subset default is NULL, returns all products |
---|---|
resolution | The product resolution c("1km", "300m"), |
product | Which product to query options are "fapar", |
ver | Product version options are "newest", "v1", "v2", "v3" |
A vector of download URL's for the products
Provides a query of the ESA's Copernicus Global Land Service global The query is performed on the manifest files and return URL's however, to download data you will need login credentials which, can be acquired from: http://land.copernicus.eu
If provided, dates need to be in a "YYYY-MM-DD" format. The dates are an explicit search string and can contain dates that are not in the imagery. As such, the user should generate a daily date string representing the range of the desired download as not to have to guess the available dates. Also note that multiple processing versions of a given image are retained in the manifest. This means that if you download a previous processing version, it could be an invalid image. It is highly recommended that you do not change the default ver="newest" argument unless there is a specific reason to.
Available products
fapar Fraction of photosynthetically active radiation absorbed by the vegetation
fcover Fraction of green vegetation cover
lai Leaf Area index
ndvi Normalized Difference Vegetation Index
Not yet implemented; Soil Water Index, Surface Soil Moisture, Copernicus product details: http://land.copernicus.eu/global/products/
Jeffrey S. Evans <jeffrey_evans@tnc.org>
# Create date string for query d <- seq(as.Date("2020/05/01"), as.Date("2020-09-01"), by="day") # Search for 300m (333m) LAI within specified date range all.urls <- cgls_urls(dates = d, resolution = 300, product = "lai") # Search for 1000m LAI within specified date range all.urls <- cgls_urls(dates = d, resolution = 1000, product = "lai") # Return all 300m LAI lai <- cgls_urls(resolution = 300, product = "lai") head( basename(lai) )#> [1] "c_gls_LAI300-RT0_202105200000_GLOBE_OLCI_V1.1.1.nc" #> [2] "c_gls_LAI300_202006300000_GLOBE_PROBAV_V1.0.1.nc" #> [3] "c_gls_LAI300_202006200000_GLOBE_PROBAV_V1.0.1.nc" #> [4] "c_gls_LAI300_202006100000_GLOBE_PROBAV_V1.0.1.nc" #> [5] "c_gls_LAI300_202005310000_GLOBE_PROBAV_V1.0.1.nc" #> [6] "c_gls_LAI300_202005200000_GLOBE_PROBAV_V1.0.1.nc"## Example of downloading URL's ## You need to define your login credentials to download data # username = "xxxx" # password = "xxxx" # # for(i in 1:length(all.urls)){ # if(i > 1){ Sys.sleep(3) } # file.url <- paste0("https://", paste(username, password, sep=":"), "@", # sub(".*//", "", all.urls[i])) # download.file(file.url, file.path(getwd(), # basename(all.urls[i])), mode = 'wb') # }