Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gediDownload

Download GEDI data


Description

Download GEDI data from LP DAAC Data Pool. Users will need to enter their Earth Explore login Information for downloading the data.

Usage

gediDownload(
  filepath,
  outdir = NULL,
  overwrite = FALSE,
  buffer_size = 512,
  timeout = 10
)

Arguments

filepath

Vector object; path to the GEDI data

outdir

Vector object, output directory for downloading GEDI data, default tempdir()

overwrite

logical; overwrite file if they already exists in destination, default FALSE

buffer_size

integer; the size of download chunk in KB to hold in memory before writing to file, default 512.

timeout

integer; connection timeout in seconds.

Value

No return value on success, on failure it will stop()

References

Credits to Cole Krehbiel. Code adapted from <https://git.earthdata.nasa.gov/projects/LPDUR/repos/daac_data_download_r/browse/DAACDataDownload.R>

Examples

## Not run: 
# Set path to GEDI data
# herein we will only download xml metedata
filepath=c(paste0(
                 "https://e4ftl01.cr.usgs.gov/GEDI/GEDI02_B.001",
                 "/2019.04.18/GEDI02_B_2019108032534_O01961_T03911_02_001_01.h5.xml"
                 ),
          paste0("https://e4ftl01.cr.usgs.gov/GEDI/GEDI02_B.001",
                 "/2019.04.18/GEDI02_B_2019108045815_O01962_T01066_02_001_01.h5.xml"
                )
         )

# Set dir to download files to
outdir=tempdir()

# Create .netrc file
netrc = file.path(outdir, ".netrc")
netrc_conn <- file(netrc)

writeLines(c("machine urs.earthdata.nasa.gov",
            sprintf("login %s", Sys.getenv("NASA_USER")),
            sprintf("password %s", Sys.getenv("NASA_PASSWORD"))
), netrc_conn)

close(netrc_conn)

#' Downloading GEDI data
gediDownload(filepath,outdir)

## End(Not run)

rGEDI

NASA's Global Ecosystem Dynamics Investigation (GEDI) Data Visualization and Processing

v0.1.11
GPL-3
Authors
Carlos Alberto Silva [aut, cre, cph], Caio Hamamura [aut, cph], Ruben Valbuena [aut, ctb], Steven Hancock [aut, ctb], Adrian Cardil [aut, ctb], Eben North Broadbent [aut, ctb], Danilo Roberti Alves de Almeida [aut, ctb], Celso H. L. Silva Junior [aut, ctb], Carine Klauberg [aut, ctb], Burton Garbow [cph] (Is the author of the MINPACK-1 Least Squares Fitting Library), Kenneth Hillstrom [cph] (Is the author of the MINPACK-1 Least Squares Fitting Library), Jorge More [cph] (Is the author of the MINPACK-1 Least Squares Fitting Library), Craig Markwardt [cph] (Is the author of the enhanced MINPACK-1 Least Squares Fitting Library)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.