Identify continuous lines in a network using an approach based on the Continuity in Steet Network (COINS) method1.
You can install the development version of rcoins from the R terminal like so:
# install.packages("devtools")
devtools::install_github("CityRiverSpaces/rcoins")
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:
Rscript -e 'devtools::install()'
Given the street network of the city of Bucharest (data source: OpenStreetMap)
library(rcoins)
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))
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))
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()