zonebuilder

R-CMD-check CRAN status CRAN RStudio mirror downloads DOI

The goal of zonebuilder is to break up large geographic regions such as cities into manageable zones. Zoning systems are important in many fields, including demographics, economy, health, and transport. The zones have standard configuration, which enabled comparability across cities. See its website at zonebuilders.github.io/zonebuilder and the academic paper that describes the package in detail here (Lovelace et al. 2022).

Installation

You can install the released version of zonebuilder from CRAN with:

install.packages("zonebuilder")

Install it from GitHub with:

# install.packages("remotes")
remotes::install_github("zonebuilders/zonebuilder")

Using zonebuilder

Zonebuilder builds on the sf package and works well with mapping packages such as ggplot2, leaflet, mapdeck, mapview and tmap, the last of which we’ll use in the following maps. Attaching the package provides the example datasets london_a() and london_c(), the geographic boundary and the centre of London:

library(zonebuilder)
library(tmap)
tmap_mode("plot")
tm_shape(london_a()) +
  tm_borders() +
  tm_shape(london_c()) +
  tm_dots("red")

The main function zb_zone breaks this geographical scale into zones. The default settings follow the ClockBoard configuration:

london_zones <- zb_zone(london_c(), london_a())
zb_plot(london_zones)

The idea behind this zoning system is based on the following principles:

The package zonebuilder does not only create zoning systems based on the CloadBoard layout as illustrated below.

The function zb_zone makes use of zb_doughnut and zb_segment, which can also be used directly:

par(mfrow = c(1, 3))
zb_plot(zb_doughnut(london_c(), london_a(), n_circles = 5), title = "Doughnuts")

zb_plot(zb_segment(london_c(), n_segments = 20), title = "Segments")

zb_plot(zb_zone(london_c(), n_circles = 4, n_segments = 4), title = "4 segments, 4 circles")

The package also contains a function to create zones based on a simple rectangular grid system:

z = zb_quadrat(london_a(), ncol = 10)
plot(z)

Contribute

Contributions are welcome!

It may be worth checking-in in a discussion post before opening an issue.

Citation

Please cite the package as follows (Lovelace et al. 2022):

@article{lovelace_clockboard_2022,
  title = {{{ClockBoard}}: {{A}} Zoning System for Urban Analysis},
  shorttitle = {{{ClockBoard}}},
  author = {Lovelace, Robin and Tennekes, Martijn and Carlino, Dustin},
  date = {2022-06-20},
  journaltitle = {Journal of Spatial Information Science},
  number = {24},
  pages = {63--85},
  issn = {1948-660X},
  doi = {10.5311/JOSIS.2022.24.172},
  url = {https://josis.org/index.php/josis/article/view/172},
  urldate = {2022-07-02},
  abstract = {Zones are the building blocks of urban analysis. Fields ranging from demographics to transport planning routinely use zones - spatially contiguous areal units that break-up continuous space into discrete chunks - as the foundation for diverse analysis techniques. Key methods such as origin-destination analysis and choropleth mapping rely on zones with appropriate sizes, shapes and coverage. However, existing zoning systems are sub-optimal in many urban analysis contexts, for three main reasons: 1) administrative zoning systems are often based on somewhat arbitrary factors; 2) zoning systems that are evidence-based (e.g., based on equal population size) are often highly variable in size and shape, reducing their utility for inter-city comparison; and 3) official zoning systems in many places simply do not exist or are unavailable. We set out to develop a flexible, open and scalable solution to these problems. The result is the zonebuilder project (with R, Rust and Python implementations), which was used to create the ClockBoard zoning system. ClockBoard consists of 12 segments emanating from a central place and divided by concentric rings with radii that increase in line with the triangular number sequence (1, 3, 6 km etc). 'ClockBoards' thus create a consistent visual frame of reference for monocentric cities that is reminiscent of clocks and a dartboard. This paper outlines the design and potential uses of the ClockBoard zoning system in the historical context, and discusses future avenues for research into the design and assessment of zoning systems.},
  issue = {24},
  langid = {english},
  keywords = {modifiable area unit problem},
  file = {C:\Users\georl_admin\Zotero\storage\QRQDMJSH\Lovelace et al. - 2022 - ClockBoard A zoning system for urban analysis.pdf}
}