FetchAndExtractCRSFromPrj: LidarIndexR - Retrieve a projection file and read CRS...

FetchAndExtractCRSFromPrjR Documentation

LidarIndexR – Retrieve a projection file and read CRS information

Description

Retrieves only the projection file related to a shapefile (same name as fileName but with .prj extensions) and then reads CRS information from the projection file.

Usage

FetchAndExtractCRSFromPrj(
  baseURL,
  folderName,
  fileName,
  tempFolder,
  fetchnew = FALSE,
  quiet = FALSE,
  ...
)

Arguments

baseURL

URL for a folder on a remote host. Trailing slash should not be included.

folderName

Folder name on the baseURL containing the shapefile.

fileName

A string containing the name of a single file. The projection file with the same name (but extension of .prj) will be retrieved. The projection file is then read to provide CRS information.

tempFolder

A valid folder name where the projection file can be temporarily stored.

fetchnew

Boolean. If TRUE, the file is always retrieved. If FALSE, the file is only retrieved if it does not already exist in the tempFolder.

quiet

Boolean to control display of status information. If TRUE, information is not displayed. Otherwise, status information is displayed.

...

Arguments passed to RCurl::getURL().

Value

String (invisible) containing a valid input value for st_crs().

Examples

## Not run: 
FetchAndExtractCRSFromPrj("ftp://rockyftp.cr.usgs.gov/vdelivery/Datasets/",
    "Staged/Hydrography/NHD/HU4/HighResolution/Shape/",
    "NHD_H_0101_HU4_Shape.prj",
    ".")

## End(Not run)

bmcgaughey1/LidarIndexR documentation built on April 14, 2025, 6:07 p.m.