View source: R/get_area_requests.R
get_area_requests | R Documentation |
Get 311 service requests for a specific area. Service requests from 2017 to 2020 area available but only a single year can be requested at a time. Duplicate requests are removed from the returned data. Requests can be filtered by request type, responsible city agency, or both. You can return multiple types or agencies, by using a custom where query parameter or by calling each type/agency separately.
get_area_requests(
area = NULL,
year = 2022,
date_range = NULL,
request_type = NULL,
agency = NULL,
where = NULL,
dist = NULL,
diag_ratio = NULL,
unit = "m",
asp = NULL,
trim = FALSE,
geometry = TRUE,
crs = pkgconfig::get_config("mapbaltimore.crs", 2804),
duplicates = FALSE,
...
)
area |
sf, sfc, or bbox object. If multiple areas are provided, they are
unioned into a single sf object using |
year |
Year for service requests. Default 2021. 2017 to 2022 supported. |
date_range |
Date range as character vector in format of c("YYYY-MM-DD", "YYYY-MM-DD"). Minimum and maximum values are used if length is greater than 1. |
request_type |
Service request type. |
agency |
City agency responsible for request. Options include "Transportation", "BGE", "Solid Waste", "Housing", "Water Wastewater", "Health", "Call Center", "Finance", "Liquor Board", "Recreation & Parks", "Fire Department", "Parking Authority", and "General Services" |
where |
string for where condition. This parameter is ignored if a request_type or agency are provided. |
dist |
buffer distance in units. Optional. |
diag_ratio |
ratio of diagonal distance of area's bounding box used as
buffer distance. e.g. if the diagonal distance is 3000 meters and the
"diag_ratio = 0.1" a 300 meter will be used. Ignored when |
unit |
Units for buffer. Supported options include "meter", "foot", "kilometer", and "mile", "nautical mile" Common abbreviations (e.g. "km" instead of "kilometer") are also supported. Distance in units is converted to units matching GDAL units for x; defaults to "meter" |
asp |
Aspect ratio of width to height as a numeric value (e.g. 0.33) or
character (e.g. "1:3"). If numeric, |
trim |
If |
geometry |
Default |
crs |
Cordinate reference system to return, Default: 4326 for
|
duplicates |
If |
... |
Arguments passed on to
|
# Get boundary for Edmondson Village
area <- get_area("neighborhood", "Edmondson Village")
# Get fallen limb requests for 2022
get_area_requests(
area = area,
date_range = c("2022-11-01", "2022-12-31"),
request_type = "FOR-Fallen Limb"
)
# Get dirty alley service requests for multiple years using purrr::map_dfr()
purrr::list_rbind(
purrr::map(
c(2021, 2020),
~ get_area_requests(
area = area,
year = .x,
request_type = "SW-Dirty Alley"
)
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.