home2park

home2park: An R package to assess the spatial provision of urban parks - Published in JOSS (2021)

https://github.com/ecological-cities/home2park

Science Score: 93.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
    Found 14 DOI reference(s) in README and JOSS metadata
  • Academic publication links
    Links to: joss.theoj.org
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
    Published in Journal of Open Source Software

Keywords

cities geoinformatics parks recreation spatial
Last synced: 6 months ago · JSON representation

Repository

home2park: Assess the spatial provision of urban parks

Basic Info
Statistics
  • Stars: 6
  • Watchers: 1
  • Forks: 2
  • Open Issues: 0
  • Releases: 2
Topics
cities geoinformatics parks recreation spatial
Created about 5 years ago · Last pushed about 2 years ago
Metadata Files
Readme Changelog Contributing License

README.Rmd

---
output: github_document
---



```{r, include = FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  fig.path = "man/figures/README-",
  out.width = "100%"
)
```

# home2park 


[![License: GPL v3](https://img.shields.io/badge/License-GPLv3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![Lifecycle: experimental](https://img.shields.io/badge/lifecycle-experimental-orange.svg)](https://www.tidyverse.org/lifecycle/#experimental)
[![R-CMD-check](https://github.com/ecological-cities/home2park/workflows/R-CMD-check/badge.svg)](https://github.com/ecological-cities/home2park/actions)
[![test-coverage](https://github.com/ecological-cities/home2park/workflows/test-coverage/badge.svg)](https://github.com/ecological-cities/home2park/actions)
[![DOI](https://joss.theoj.org/papers/10.21105/joss.03609/status.svg)](https://doi.org/10.21105/joss.03609)


## Spatial Provision of Urban Parks

Assess the spatial provision of urban parks to residential buildings city-wide. Refer to [package website](https://ecological-cities.github.io/home2park/) for demonstrations of how the package may be used.

## Installation

Install the development version of `home2park` from GitHub:

```{r, eval = FALSE}
devtools::install_github("ecological-cities/home2park", ref = "main")
```

## Setup

Load the package:

```{r eval = FALSE}
library(home2park)
```

```{r include = FALSE, eval = TRUE}
devtools::load_all() # to knit manually w latest changes (not built/installed yet)
```

## Citation

To cite `home2park` or acknowledge its use, please cite the following:

*Song, X. P., Chong, K. Y. (2021). home2park: An R package to assess the spatial provision of urban parks. Journal of Open Source Software, 6(65), 3609. https://doi.org/10.21105/joss.03609*  



To get a BibTex entry, run `citation("home2park")`.
## Background Parks are important spaces for recreation and leisure in cities. Conventional measures of park provision tend to rely on summaries of park area within a given region (e.g. per capita park area). However, there is a need to characterise the wide variety of parks (e.g. nature areas, gardens, waterfront parks, outdoor playgrounds, etc.) that serve different groups of people. When planning at fine spatial scales, such current metrics are also limited by their coarse spatial resolution and the presence of artificial boundaries.
## Using home2park The package `home2park` provides a way to measure _multiple aspects_ of park provision to homes, at the resolution of _individual buildings_. The key features include the ability to: - Download relevant data from OpenStreetMap (OSM) such as buildings, parks and features related to recreation. The user may also supply data for new buildings and parks, for the purpose of future scenario planning. - Redistribute coarse-scale population data per census unit into residential buildings, also known as ‘dasymetric mapping’, which helps highlight specific areas where more people will benefit from the presence of parks. - Summarise at each park multiple attributes that are important for recreation (e.g. dense vegetation, length of waterfronts, open spaces, trails, etc.). - Calculate the supply (provision) of the park attributes to each residential building, while accounting for 'distance decay', or the fact that supply from parks further away are reduced. The following sections provide a high-level overview of the various steps required to measure the spatial provision of parks. Further details and code examples can be found in the package vignette '[Get started](https://ecological-cities.github.io/home2park/articles/home2park.html)'. ### 1. Process city population Residential buildings (homes) are an important component of the analysis. These may be obtained, for example, by downloading building polygons from OpenStreetMap (OSM), and subsetting the dataset to areas within 'residential' land use zones. In addition, having the population count per residential building allows us to calculate the total spatial provision of parks to all residents, and can help highlight important areas where more people will benefit from the presence of parks. Coarse-scale population census data can be redistributed into the residential buildings, via a technique known as 'dasymetric mapping'. The number of building 'levels' from OSM can be used as a proxy for population density (i.e. more residents per unit area). Here's an example screenshot showing an overlay of multiple example datasets in the package (for the city of Singapore), which were used to redistribute population data per census unit (subzones) across residential buildings. ```{r, echo=FALSE, fig.align = "center", out.width="80%", fig.cap = paste0("Example screenshot showing an overlay of multiple datasets used to redistribute the population across buildings within residential land use zones. The legends are ordered (top to bottom) by increasing spatial resolution.")} knitr::include_graphics("man/figures/README-dasymetric-mapping.png") ```
Residential building polygons in Singapore each with a population count can be found in the following example dataset: ```{r} data(buildings_pop_sgp) head(buildings_pop_sgp) ```
### 2. Process parks Parks are the other important component of the analysis. These may be downloaded from OSM and processed using this package. The following example dataset contains parks in Singapore with selected attributes related to recreation/leisure: ```{r} data(parks_sgp) head(parks_sgp[, 28:33]) # subset to relevant columns ```
### 3. Recreation supply With the processed building and park polygons, the provision of park attributes per residential building can be calculated. The total supply $S$ of each park attribute to a building is calculated based on the following equation. Its value depends on the distances between that particular building and all parks; attributes from parks further away are reduced as a result of the negative exponential function _e-cd_, an effect also known as the 'distance decay' ([Rossi et al., 2015](http://dx.doi.org/10.1016/j.apgeog.2015.06.008)). ```{r, echo=FALSE, fig.align = "center", out.width="18%"} knitr::include_graphics("man/figures/README-equation.png") ``` where - $S$ = Total supply of a specific park attribute to the building from parks $i$; $i$ = 1,2,3, ... $n$ where $n$ = total number of parks citywide. - $s_{i}$ = Supply of a specific park attribute from park $i$. A perfect positive linear association is assumed, since the focus is on supply metrics. - $d_{i}$ = Distance in kilometres from the building to park $i$ (e.g. Euclidean, Manhattan, etc.). - $c$ = Coefficient determining rate of decay in supply $s_{i}$ with increasing distance.
Note that the value of Coefficient $c$ depends on both park and park visitors' attributes, such as socio-demographic factors and preferences for activities that may impel shorter or longer travel ([Rossi et al., 2015](http://dx.doi.org/10.1016/j.apgeog.2015.06.008); [Tu et al.](https://doi.org/10.1016/j.ufug.2020.126689)). A lower value implies that parks further away are accessible or frequently visited by residents (i.e. still contributes to the 'recreation supply' of a particular building). ```{r, echo=FALSE, fig.align = "center", out.width="50%", fig.cap = paste0("Figure: The value of Coefficient c and its effect on the distance decay between a building and park.")} knitr::include_graphics("man/figures/README-c-sensitivity.png") ```
```{r, echo=FALSE, fig.align = "center", out.width="100%", fig.cap = paste0("Screenshot: Examples showing the supply of OSM park area to residential buildings in Singapore for the year 2020 when the value of Coefficient c is 0.1 (left panel) and 1 (right panel). Each building is denoted as a pount (a random subset is shown). The color palette for the buildings (points) is binned according to quantile values.")} knitr::include_graphics("man/figures/README-c-sensitivity-map.png") ```
To calculate the supply of each park attribute, we first calculate the pairwise distances between all buildings and parks (a distance matrix). This output is supplied to the function `recre_supply()`. For example, we can calculate the supply of park _area_ to each building. This supply value can then be multiplied by the population count per building, to obtain the total supply to all residents. ```{r calc distance matrix and supply of park area, message = FALSE, warning = FALSE} # transform buildings & parks to projected crs buildings_pop_sgp <- sf::st_transform(buildings_pop_sgp, sf::st_crs(32648)) parks_sgp <- sf::st_transform(parks_sgp, sf::st_crs(32648)) # convert buildings to points (centroids), then calculate distances to every park m_dist <- buildings_pop_sgp %>% sf::st_centroid() %>% sf::st_distance(parks_sgp) %>% # euclidean distance units::set_units(NULL) m_dist <- m_dist / 1000 # convert distances to km # new column for the supply of park area buildings_pop_sgp$area_supply <- recre_supply(park_attribute = parks_sgp$area, dist_matrix = m_dist, c = 0.302) # e.g. from Tu et al. (2020) # supply to all residents per building buildings_pop_sgp$area_supplytopop <- buildings_pop_sgp$area_supply * buildings_pop_sgp$popcount ``` ```{r, echo=FALSE, fig.align = "center", out.width="100%", fig.cap = paste0("Screenshot: Supply of park area to building residents in Singapore based on OSM data (2020). Each building is denoted as a point (a random subset is shown). The value for Coefficient c was set at 0.302. The color palette is binned according to quantile values.")} knitr::include_graphics("man/figures/README-supply-parkarea-to-building-residents.png") ``` ```{r include = FALSE} rm(buildings_pop_sgp, parks_sgp, pop_sgp, m_dist) ```
## Data sources - Singapore census data from the [Department of Statistics Singapore](https://www.singstat.gov.sg/find-data/search-by-theme/population/geographic-distribution/latest-data). Released under the terms of the [Singapore Open Data Licence version 1.0](https://data.gov.sg/open-data-licence). - Singapore subzone polygons from the [Singapore Master Plan Subzones](https://data.gov.sg/dataset/master-plan-2019-subzone-boundary-no-sea). Released under the terms of the [Singapore Open Data Licence version 1.0](https://data.gov.sg/open-data-licence). - Singapore Master Plan Land Use Zones for the years [2014](https://data.gov.sg/dataset/master-plan-2014-land-use) and [2019](https://data.gov.sg/dataset/master-plan-2019-land-use-layer). Released under the terms of the [Singapore Open Data License](https://data.gov.sg/open-data-licence). - Building polygons derived from map data [copyrighted](https://www.openstreetmap.org/copyright) OpenStreetMap contributors and available from https://www.openstreetmap.org. Released under the terms of the [ODbL License](https://opendatacommons.org/licenses/odbl/summary/). - Park polygons and summarised attributes (trails, playgrounds) derived from map data [copyrighted](https://www.openstreetmap.org/copyright) OpenStreetMap contributors and available from https://www.openstreetmap.org. Released under the terms of the [ODbL License](https://opendatacommons.org/licenses/odbl/summary/).
## References Rossi, S. D., Byrne, J. A., & Pickering, C. M. (2015). The role of distance in peri-urban national park use: Who visits them and how far do they travel?. _Applied Geography_, 63, 77-88. Tu, X., Huang, G., Wu, J., & Guo, X. (2020). How do travel distance and park size influence urban park visits?. _Urban Forestry & Urban Greening_, 52, 126689.

JOSS Publication

home2park: An R package to assess the spatial provision of urban parks
Published
September 20, 2021
Volume 6, Issue 65, Page 3609
Authors
Xiao Ping Song ORCID
Department of Biological Sciences, National University of Singapore
Kwek Yan Chong ORCID
Department of Biological Sciences, National University of Singapore
Editor
Martin Fleischmann ORCID
Tags
Distance decay Dasymetric map Outdoor recreation Park provision Recreation supply Service area Spatial distribution Urban green space Urban parks

GitHub Events

Total
Last Year

Committers

Last synced: 7 months ago

All Time
  • Total Commits: 84
  • Total Committers: 2
  • Avg Commits per committer: 42.0
  • Development Distribution Score (DDS): 0.012
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
xpsong x****t@g****m 83
Nick Bearman n****k@g****k 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 1
  • Total pull requests: 1
  • Average time to close issues: 1 day
  • Average time to close pull requests: about 24 hours
  • Total issue authors: 1
  • Total pull request authors: 1
  • Average comments per issue: 1.0
  • Average comments per pull request: 0.0
  • Merged pull requests: 1
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 0
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 0
  • Pull request authors: 0
  • Average comments per issue: 0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • nickbearman (1)
Pull Request Authors
  • nickbearman (1)
Top Labels
Issue Labels
Pull Request Labels

Dependencies

DESCRIPTION cran
  • R >= 2.10 depends
  • checkmate * imports
  • dplyr >= 1.0.5 imports
  • glue * imports
  • lwgeom >= 0.2.6 imports
  • magrittr * imports
  • methods * imports
  • osmextract >= 0.2.1 imports
  • raster >= 3.4.5 imports
  • rlang * imports
  • sf >= 0.9.8 imports
  • smoothr >= 0.1.2 imports
  • stars >= 0.5.2 imports
  • stats * imports
  • stringr * imports
  • terra >= 1.1.4 imports
  • tidyr >= 1.1.3 imports
  • tidyselect * imports
  • units * imports
  • knitr * suggests
  • rmarkdown * suggests
  • spelling * suggests
  • testthat >= 3.0.0 suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/checkout v2 composite
  • r-lib/actions/setup-r v1 composite
.github/workflows/test-coverage.yaml actions
  • actions/cache v2 composite
  • actions/checkout v2 composite
  • r-lib/actions/setup-pandoc v1 composite
  • r-lib/actions/setup-r v1 composite