get_batch | R Documentation |
This batch loading/saving function is less flexible than
get_area_data()
can reduce the need for repetitive calls to get_area_data()
when gathering area-level data for mapping.
get_data_batch()
calls get_area_data()
.
get_area_batch()
calls get_area()
using the provided area as the location parameter.
get_data_batch(
get = NULL,
area = NULL,
label = get,
adj = list(dist = 15, diag_ratio = NULL, asp = "6:4"),
fn = NULL,
batch = NULL,
crop = TRUE,
trim = FALSE,
load = TRUE,
cache = FALSE,
save = FALSE,
filetype = "geojson",
crs = pkgconfig::get_config("mapbaltimore.crs", 2804),
...
)
get_area_batch(
get = NULL,
area = NULL,
label = get,
adj = list(dist = 15, diag_ratio = NULL, asp = "6:4"),
fn = NULL,
batch = c("neighborhood", "council district", "csa", "tract"),
trim = FALSE,
load = TRUE,
save = FALSE,
cache = FALSE,
filetype = "geojson",
crs = pkgconfig::get_config("mapbaltimore.crs", 2804),
...
)
get |
Type of geography to use in setting the area of data to load or save. Supported values area "area", "street", or "intersection". Default: NULL |
area |
An sf object to use instead of getting an area, street, or intersection. Only used if get is NULL. |
label |
Label to use for the loaded objects or saved files, Defaults to the same as the get parameter. |
adj |
Named list with parameters used by |
fn |
Function to apply to area after returning it. Useful for applying a buffer to a street or creating a walking distance isochrone to use as the bounding box for an intersection. |
batch |
A character string or named list.
|
crop |
If FALSE, return data that intersects with the bounding box of
the area, street, or intersection but do not crop to the bounding box. This
parameter is not supported for |
trim |
If TRUE (and if adj is NULL), trim the data to the area, street, or intersection. Default: FALSE. |
load |
If TRUE, load the datasets to the global environment, Default: TRUE |
cache |
If TRUE, cache the datasets to the package cache folder with
|
save |
If TRUE, save the selected areas and datasets locally as a file (using the filetype parameter as a file extension)., Default: FALSE |
filetype |
File extension supported by |
crs |
Coordinate reference system |
... |
Parameters passed to |
## Not run:
if (interactive()) {
# Load streets and cached edge of pavement data for the Harwood neighborhood
get_data_batch(
get = "area",
label = "harwood",
type = "neighborhood",
area_name = "Harwood",
batch = c("streets", "edge_of_pavement"),
load = TRUE,
save = FALSE
)
# Save parks, trees, and vegetated area w/in 800 meters
# of the intersection of E. Pratt and Light Sts. to GeoJSON files
get_data_batch(
get = "intersection",
street_names = "E PRATT ST & LIGHT ST",
adj = list(dist = 0, diag_ratio = NULL, asp = "1:1"),
dist = 800,
batch = c("parks", "trees", "vegetated_area")
)
}
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.