MyNixOS website logo
Description

Identify Naturally Continuous Lines in a Spatial Network.

Provides functionality to group lines that form naturally continuous lines in a spatial network. The algorithm implemented is based on the Continuity in Street Networks (COINS) method from Tripathy et al. (2021) <doi:10.1177/2399808320967680>, which identifies continuous "strokes" in the network as the line strings that maximize the angles between consecutive segments.

rcoins

R-CMD-check DOI

Identify continuous lines in a network using an approach based on the Continuity in Steet Network (COINS) method[^1].

rcoins is a R (re)implementation of the COINS algorithm, which is also available in Python as a module of the momepy library or in its original version: PratyushTripathy/COINS.

[^1]: Tripathy, P., Rao, P., Balakrishnan, K., & Malladi, T. (2021). An open-source tool to extract natural continuity and hierarchy of urban street networks. Environment and Planning B: Urban Analytics and City Science, 48(8), 2188-2205. DOI: 10.1177/2399808320967680

Installation

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

install.packages("rcoins")

You can install the development version of rcoins from the R terminal like so:

# install.packages("devtools")
devtools::install_github("CityRiverSpaces/rcoins")

Alternative installation using conda

An environment including rcoins and all its dependencies can be created using Conda (or its faster implementation Mamba).

Conda can be installed using the Miniforge scripts provided here (download one of the Mambaforge scripts in order to install Mamba as well).

First clone this repository and access it:

git clone https://github.com/CityRiverSpaces/rcoins.git
cd rcoins/

Run conda (or mamba, if using Mambaforge) to create an environment with all the required dependencies:

conda env create -f environment.yml
conda activate rcoins

Install the development version of rcoins (include dependencies = TRUE to install the example datasets):

Rscript -e 'devtools::install(dependencies = TRUE)'

Example

Given the street network of the city of Bucharest (data source: OpenStreetMap)

library(rcoins)
bucharest <- get_example_data()
streets <- bucharest$streets
Plot streets
plot(sf::st_geometry(streets),
     col = sf::sf.colors(n = nrow(streets), categorical = TRUE),
     lwd = 5, xlim = c(418500, 437500), ylim = c(4909800, 4931500))
Bucharest streets

Determine continuous lines in the network as:

continuous_streets <- stroke(streets)
Plot continuous streets
plot(continuous_streets,
     col = sf::sf.colors(n = length(continuous_streets), categorical = TRUE),
     lwd = 5, xlim = c(418500, 437500), ylim = c(4909800, 4931500))
Bucharest continuous streets

Contributing

We look very much forward to contributions to the package. See the Contributing Guide for further details.

This package is released with a Contributor Code of Conduct. By contributing to this project you agree to abide by its terms.

Development

When modifying the R source code, load the library as:

devtools::load_all()

Run tests locally:

devtools::test()

Run the linter locally:

lintr::lint_package()
Metadata

Version

0.3.2

License

Unknown

Platforms (75)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-windows
  • aarch64_be-none
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-windows