get_area | R Documentation |
Get a sf object with one or more neighborhoods, Baltimore City Council
districts, Maryland Legislative Districts, U.S. Congressional Districts,
Baltimore Planning Districts, Baltimore Police Districts, or Community
Statistical Areas, park districts, or Census blocks, block groups, or tracts.
Area type is required and can be used in combination with area name, area id
(not supported by all data sets), or location (as an address or sf object).
Name and id are not supported for U.S. Census geogrpahies. Use the location
parameter to return any areas of the selected type that intersect with the
specified location. get_baltimore_area()
has different parameter names
(more consistent with getdata::get_location()
) and is now recommended over
get_area()
to avoid a name conflict with the sfext::get_area()
function.
get_area(
type = c("neighborhood", "council district", "legislative district",
"congressional district", "planning district", "police district", "csa",
"park district", "block", "block group", "tract"),
area_name = NULL,
area_id = NULL,
location = NULL,
union = FALSE,
area_label = NULL
)
get_baltimore_area(
type = NULL,
name = NULL,
id = NULL,
location = NULL,
union = FALSE,
label = NULL
)
get_neighborhood(name, location = NULL, union = FALSE, ...)
type |
Required. Area type matching one of the boundary datasets included with mapbaltimore. Supported values include "neighborhood", "council district", "legislative district", "congressional district", "planning district", "police district", "csa", "park district". U.S. Census geographies including "block", "block group", and "tract" are supported when using the location parameter only. |
area_name |
name or names matching id column in data of selected dataset. Character. |
area_id |
identifier or identifiers matching id column of selected dataset. Not all supported datasets have an id column and the id may be an integer or character depending on the dataset. |
location |
Location supports to types of values: an address that can be
geocoded using |
union |
If TRUE and multiple area names are provided, the area geometry
is combined with |
area_label |
Label to use as name for area if union is |
name |
Passed to area_name by |
id |
Passed to area_id by |
label |
Passed to area_label by |
... |
Additional parameters passed by |
neighborhoods,council_districts,legislative_districts,
congressional_districts,planning_districts,police_districts,csas,
park_districts
tidygeocoder::geo()
# Get the Harwood neighborhood by name
get_area(
type = "neighborhood",
area_name = "Harwood"
)
# Get City Council District 12 and 14 by id
get_area(
type = "council district",
area_id = c(12, 14)
)
# Get the east and southeast planning districts and combine them
get_area(
type = "planning district",
area_id = c("East", "Southeast"),
union = TRUE,
area_label = "East and Southeast Planning Districts"
)
# Get legislative district for Walters Art Museum (600 N Charles St)
get_area(
type = "legislative district",
location = "600 N Charles St, Baltimore, MD 21201"
)
# Get Census tracts for the Edmondson Village neighborhood
get_area(
type = "tract",
location = get_area("neighborhood", "Edmondson Village")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.