bcdc_options: Retrieve options used in bcdata, their value if set and the...

View source: R/bcdc_options.R

bcdc_optionsR Documentation

Retrieve options used in bcdata, their value if set and the default value.

Description

This function retrieves bcdata specific options that can be set. These options can be set using ⁠option({name of the option} = {value of the option})⁠. The default options are purposefully set conservatively to hopefully ensure successful requests. Resetting these options may result in failed calls to the data catalogue. Options in R are reset every time R is re-started. See examples for additional ways to restore your initial state.

Usage

bcdc_options()

Details

bcdata.max_geom_pred_size is the maximum size in bytes of an object used for a geometric operation. Objects that are bigger than this value will have a bounding box drawn and apply the geometric operation on that simpler polygon. The bcdc_check_geom_size function can be used to assess whether a given spatial object exceeds the value of this option. Users can iteratively try to increase the maximum geometric predicate size and see if the bcdata catalogue accepts the request.

bcdata.chunk_limit is an option useful when dealing with very large data sets. When requesting large objects from the catalogue, the request is broken up into smaller chunks which are then recombined after they've been downloaded. This is called "pagination". bcdata does this all for you, however by using this option you can set the size of the chunk requested. On slower connections, or when having problems, it may help to lower the chunk limit.

bcdata.single_download_limit Deprecated. This is the maximum number of records an object can be before forcing a paginated download; it is set by querying the server capabilities. This option is deprecated and will be removed in a future release. Use bcdata.chunk_limit to set a lower value pagination value.

Examples


## Save initial conditions
try(
  original_options <- options()
)

## See initial options
try(
  bcdc_options()
)

try(
  options(bcdata.max_geom_pred_size = 1E6)
)

## See updated options
try(
  bcdc_options()
)

## Reset initial conditions
try(
 options(original_options)
)


bcgov/bcdata documentation built on Nov. 22, 2023, 6:06 p.m.