Returns data for a selected area or areas with an optional buffer. If both
crop and trim are FALSE, the function uses sf::st_intersects()
to
filter data to include the full geometry of anything that overlaps with the
area or bbox (if the area is not provided).
Usage
get_area_data(
area = NULL,
bbox = NULL,
data = NULL,
extdata = NULL,
cachedata = NULL,
path = NULL,
url = NULL,
fn = NULL,
diag_ratio = NULL,
dist = NULL,
asp = NULL,
crop = TRUE,
trim = FALSE,
crs = NULL
)
Arguments
- area
sf
object. If multiple areas are provided, they are unioned into a single sf object usingsf::st_union()
- bbox
bbox
object defining area used to filter data. If an area is provided, the bounding box is ignored.- data
sf
object including data in area- extdata
Character. Name of an external geopackage (.gpkg) file included with the package where selected data is available. Available data includes "trees", "unimproved_property", and "vegetated_area"
- cachedata
Character. Name of a cached geopackage (.gpkg) file where selected data is available. Running
cache_mapbaltimore_data()
caches data for "real_property", "baltimore_msa_streets", and "edge_of_pavement"- path
Character. Path to local or remote spatial data file supported by
sf::st_read()
- url
Character. URL for FeatureServer or MapServer layer to pass to get_area_esri_data.
- fn
Function to apply to area data before returning.
- diag_ratio
ratio to set map extent based diagonal distance of area's bounding box. Ignored when
dist
is provided.- dist
buffer distance in meters. Optional.
- asp
Aspect ratio of width to height as a numeric value (e.g. 0.33) or character (e.g. "1:3").
- crop
If TRUE, data cropped to area or bounding box
sf::st_crop()
adjusted by thedist
,diag_ratio
, andasp
parameters provided. DefaultTRUE
.- trim
If TRUE, data trimmed to area with
sf::st_intersection()
. This option is not supported for any adjusted areas that use thedist
,diag_ratio
, orasp
parameters. DefaultFALSE
.- crs
Coordinate Reference System (CRS) to use for the returned data. The CRS of the provided data and bounding box or area must match one another but are not required to match the CRS provided by this parameter.