hit_national_map_api: Hit the USGS 3DEP API and retrieve an elevation heightmap

Description Usage Arguments Value Additional Arguments See Also Examples

View source: R/hit_api.R

Description

This function retrieves a single tile of data from a single National Map service and returns the raw response. End users are recommended to use get_tiles instead, as it does much more validation and provides a more friendly interface. For a description of the datasets provided by the National Map, see https://apps.nationalmap.gov/services

Usage

1
2
3
4
5
6
7
8
hit_national_map_api(
  bbox,
  img_width,
  img_height,
  service,
  verbose = FALSE,
  ...
)

Arguments

bbox

A list representing the bounding box (bottom left and top left coordinate pairs).

img_width

The number of pixels in the x direction to retrieve

img_height

The number of pixels in the y direction to retrieve

service

A string indicating what service API to use. For a full list of available services, see get_tiles. Short codes are not accepted by this function.

verbose

Logical: Print out the number of tries required to pull each tile? Default FALSE.

...

Additional arguments passed to the National Map API. These can be used to change default query parameters or as additional options for the National Map services. See below for more information.

Value

A raw vector.

Additional Arguments

The ... argument can be used to pass additional arguments to the National Map API or to edit the hard-coded defaults used by this function. Some of the most useful options that can be changed include:

Pass these arguments to hit_national_map_api like you would any other argument to substitute new values. Note that ... values are never validated before being used; passing invalid parameters to ... will cause data retrieval to fail.

See Also

get_tiles for a friendlier interface to the National Map API.

Other data retrieval functions: get_tiles()

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Not run: 
hit_national_map_api(
  bbox = list(
    c(lat = 44.10438, lng = -74.01231),
    c(lat = 44.17633, lng = -73.91224)
  ),
  img_width = 8000,
  img_height = 8000,
  service = "3DEPElevation"
)

## End(Not run)

terrainr documentation built on Feb. 23, 2021, 9:06 a.m.