https://github.com/elipousson/birdseyeview
π¦πΊοΈ A R package for making community planning maps.
https://github.com/elipousson/birdseyeview
r-package rspatial rstats urban-planning
Last synced: 4 months ago
JSON representation
π¦πΊοΈ A R package for making community planning maps.
- Host: GitHub
- URL: https://github.com/elipousson/birdseyeview
- Owner: elipousson
- License: other
- Created: 2022-03-04T16:55:20.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-21T03:09:58.000Z (about 3 years ago)
- Last Synced: 2025-02-28T12:38:54.284Z (8 months ago)
- Topics: r-package, rspatial, rstats, urban-planning
- Language: R
- Homepage: https://elipousson.github.io/birdseyeview/
- Size: 3.04 MB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.Rmd
- License: LICENSE
Awesome Lists containing this project
README
---
output: github_document
---```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>",
fig.path = "man/figures/README-",
out.width = "100%"
)
```# birdseyeview
[](https://CRAN.R-project.org/package=birdseyeview)
[](https://lifecycle.r-lib.org/articles/stages.html#experimental)The goal of birdseyeview is to make it easy to create the types of maps, plots, and tables used for community plans.
This package was initially designed to use the [overedge package](https://elipousson.github.io/overedge/) and data packages like [mapbaltimore](https://elipousson.github.io/mapbaltimore/) or [bcpss](https://elipousson.github.io/bcpss/) to create reproducible maps and tables for a range of needs. The {overedge} package has since been superseded by sfext, getdata, and maplayer. maplayer incorporated most of the mapping functions creating for birdseyeview. These duplicative functions were removed from birdseyeview in Setember 2022.
## Installation
You can install the development version of birdseyeview like so:
``` r
remotes::install_github("elipousson/birdseyeview")
```## Example
```{r setup}
library(birdseyeview)
library(getdata)
library(sfext)
library(maplayer)
```### Make tables
```{r gt_sf_rows}
parks <-
getdata::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_sf_rows(fill = "forestgreen", color = "lightgreen", size = 6)
``````{r tbl_photo_key, eval = FALSE}
park_photos <-
getdata::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
```{r}
library(ggplot2)
``````{r layer_show_context}
ggplot() +
maplayer::layer_location_context(
data = parks[245, ],
fill = "green",
context = parks,
context_params = list(fill = "forestgreen", color = "gray60", alpha = 1)
)
``````{r make_group_layers, eval=FALSE}
# make_group_layers has been dropped from birdseyeview but isn't available in maplayer yet
park_district_layers <-
make_group_layers(
data = parks %>% sf::st_centroid(),
mapping = aes(color = name),
groupname_col = "park_district"
)clifton_district <-
getdata::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()
```