downloadPR: Automatic download of vcf data from a list of pathrows

Description Usage Arguments Details Value Author(s) References Examples

Description

Automates the download of Landsat based vcf products (Tree cover and tree cover change) from the ftp server, from a list of list of pathrows. Writes status of the download to a log file and recreates the directory organization of the ftp server locally.

Usage

1
2
downloadPR(pr, name = "TC", year, dir, log = NULL,
  baseURL = "ftp://ftp.glcf.umd.edu/glcf/", stubborn = 5)

Arguments

pr

List or numeric list. Classically the returned object from getPR.

name

Character. Product name you wish to download. At the moment 'FCC' and 'TC' can be downloaded.

year

Numeric or list. When name = 'TC', a single numeric must be provided. A list of numerics (e.g. c(2000, 2005) corresponding to the beginning and end of the change interval must ve provided when dowloading Forest Cover Change data).

dir

Character. Directory where to write the downloaded data.

log

character. filename of the logfile. If NULL (default), a file 'downloadVCF.log' is created at the root of dir

baseURL

character.

stubborn

Numeric. Number of retries when for a reason or another the download fails

Details

Files are downloaded only if they have not been downloaded and written at the same location earlier, the files overwrite previous downloaded files that are == 0 bytes. (Performs some sort of updating of a local archive)

Value

The list of file downloaded, plus eventual warning, or error messages

Author(s)

Loic Dutrieux

References

Land cover: See http://landcover.org/data/landsatTreecover/ Forest cover change: See http://landcover.org/data/landsatFCC/

Examples

1
2
3
4
5
6
7
8
## Not run: 
pr <- getPR('Belize')
pr
dir = tempdir()
downloadPR(pr, year=2000, name = 'TC', dir=dir)


## End(Not run)

loicdtx/VCF documentation built on May 21, 2019, 7:37 a.m.