The goal of birdseyeview is to make it easy to create the types of maps, plots, and tables used for community plans. This package is designed to use the overedge package and data packages like mapbaltimore or bcpss to create reproducible maps and tables for a range of needs.
Installation
You can install the development version of birdseyeview like so:
remotes::install_github("elipousson/birdseyeview")
Example
library(birdseyeview)
library(overedge)
Make tables
parks <-
get_location_data(
data = "parks",
package = "mapbaltimore"
)
parks %>%
dplyr::slice_head(n = 4) %>%
dplyr:::select(name, address, park_district, acres, geometry) %>%
dplyr::group_by(park_district) %>%
gt::gt() %>%
gt_geom_sf_rows(fill = "forestgreen", color = "lightgreen", size = 6)
name | address | acres | geometry |
---|---|---|---|
Clifton | |||
32nd Street Park | 301 E 32nd St | 0.1687215 [acres] | |
Adams Park | 1530 Montpelier St | 0.6228433 [acres] | |
Alhambra Park | 5200 Alhambra Ave | 0.9927691 [acres] | |
Gwynns Falls | |||
Alexander Odum Park | 3111 Presstman St | 1.3572058 [acres] |
park_photos <-
overedge::get_flickr_photos(
user_id = "baltimoreheritage",
tags = "druidhillpark",
img_size = "m",
sort = "date-posted",
per_page = 20
)
park_photos[1:6, ] %>%
dplyr::select(title, datetaken, image_height, image_width, image_url) %>%
tbl_photo_key(photo_col = "image_url", orientation = "landscape", number = TRUE)
Make maps
ggplot() +
layer_show_context(
data = parks[245, ],
fill = "green",
context = parks,
context_aes = list(fill = "forestgreen", color = "gray60", alpha = 1)
)
park_district_layers <-
make_group_layers(
data = parks %>% sf::st_centroid(),
mapping = aes(color = name),
groupname_col = "park_district"
)
#> Warning in st_centroid.sf(.): st_centroid assumes attributes are constant over
#> geometries of x
clifton_district <-
get_location(
type = "park_districts",
package = "mapbaltimore",
name = "Clifton"
)
ggplot() +
park_district_layers[[1]] +
guides(color = "none") +
layer_show_location(
data = clifton_district
) +
theme_void()