fetchUSGSProjectIndex: USGS Lidar Toolkit - Download Lidar Project Index

View source: R/FetchFunctions.R

fetchUSGSProjectIndexR Documentation

USGS Lidar Toolkit – Download Lidar Project Index

Description

Retrieve the USGS lidar project index file. The project index file contains project area boundaries for all USGS lidar data. Additional attributes provide information about the acquisition such as the starting and ending collection dates, pulse density, quality level, work unit identifier and the work package identifier. The index is stored in geopackage format and can be somewhat large. The index is refreshed whenever new data is added to the USGS collection.

Usage

fetchUSGSProjectIndex(
  destfile = "",
  url = "",
  type = "WESM",
  method = "libcurl",
  ...
)

Arguments

destfile

A character string specifying the file name for the downloaded index. If not provided or empty, the index is stored in the current working directory using the filename in the url.

url

A character string with the URL for the project index file. If an empty string, the URL for the project index corresponding type is fetched. When type = "FESM", the URL for FESM_LPC_PROJ.gpkg is used. The FESM index has not been updated since May 2020. The WESM index should be used for nearly all work. When type = "WESM", the URL for WESM.gpkg is used. This is the default. When type = "ENTWINE" is used, the URL for the USGS Entwine data index maintained by Howard Butler is used. When type = "ENTWINEPLUS" is used, the URL for the enhanced USGS Entwine data index produced by Robert J. McGaughey is used.

type

A character string specifying the index to use. Valid values are "WESM", "FESM", "ENTWINE", or "ENTWINEPLUS".

method

Method used with download.file(). Refer to download.file() documentation for possible methods.

...

Additional arguments passed to download.file().

Details

When retrieving large files, it may be necessary to increase the timeout period so downloads can complete. This is done using the following line of code (sets timeout to 5000 seconds):

options(timeout = max(5000, getOption("timeout")))

You can also download the project index manually and then use setUSGSProjectIndex() to activate the index for use with USGSlidar functions.

Value

An (invisible) integer code, 0 for success and non-zero for failure. This is the value returned from download.file.

Examples

## Not run: 
fetchUSGSProjectIndex()
fetchUSGSProjectIndex("Project.gpkg")
fetchUSGSProjectIndex("Project.gpkg", method = "wininet")

## End(Not run)

bmcgaughey1/USGSlidar documentation built on June 23, 2024, 1:25 a.m.