Learn R Programming

rcrisp

rcrisp provides tools to automate the morphological delineation of riverside urban areas following a method developed in Forgaci (2018, pp. 88–89). The method is based on the premise that analyses of riverside urban phenomena are often done without a clear and consistent spatial definition of the area of interest and that a morphological delineation can provide a more objective and comparable approach.

Accordingly, the method proposes a hierarchical delineation of four spatial units: the river valley, the river corridor, the corridor segments and the river space. These units are defined based on the combined morphologies of the river valley and urban form. The resulting delineations can be used in any downstream analysis of riverside urban areas that can benefit from consistent and comparable spatial units, including land use, accessibility, and ecosystem services assessments.

The package includes functions to delineate the river valley, the river corridor, the corridor segments, and the river space (i.e., the area between the riverbanks and the first line of buildings) as well as an all-in-one function that runs all desired delineations. The package also includes functions to download and preprocess OpenStreetMap (OSM) and global Digital Elevation Model (DEM) data, which are required as input data for the delineation process.

Workflow at a glance

  1. (Optionally) get OSM and DEM base layers
  2. Run the all-in-one delineate() or delineation-specific delineate_*() functions to compute valley, corridor, segments, and/or river space
  3. Visualize/export results for downstream analysis

See the Getting started vignette for further details about the purpose of the package, an end-to-end example, data requirements, and indication of use cases.

Installation

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

install.packages("rcrisp")

You can install the development version of rcrisp from GitHub with:

# install.packages("pak")
pak::pak("CityRiverSpaces/rcrisp")

Example

This is a basic example which shows you how to solve a common problem:

library(rcrisp)

# Set location parameters
city_name <- "Bucharest"
river_name <- "Dâmbovița"
epsg_code <- 32635

# Delineate river corridor
bd <- delineate(city_name, river_name, segments = TRUE)

# Get base layers for plotting
bb <- get_osm_bb(city_name)
streets <- get_osm_streets(bb, epsg_code)$geometry
railways <- get_osm_railways(bb, epsg_code)$geometry

# Plot results
plot(bd$corridor)
plot(railways, col = "darkgrey", add = TRUE, lwd = 0.5)
plot(streets, add = TRUE)
plot(bd$segments, border = "orange", add = TRUE, lwd = 3)
plot(bd$corridor, border = "red", add = TRUE, lwd = 3)

Contributing

rcrisp is in a stable state of development, with some degree of active subsequent development as envisioned by the primary authors.

We also look very much forward to contributions. 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.

References

Forgaci, C. (2018). Integrated urban river corridors: Spatial design for social-ecological integration in bucharest and beyond [PhD thesis]. https://doi.org/10.7480/abe.2018.31

Copy Link

Version

Install

install.packages('rcrisp')

Monthly Downloads

213

Version

0.3.1

License

Apache License (>= 2)

Maintainer

Claudiu Forgaci

Last Published

November 24th, 2025

Functions in rcrisp (0.3.1)

get_corridor_edges

Split corridor along the river to find edges on the two banks
filter_clusters

Cluster the river crossings and select the shortest crossing per cluster
get_osm_example_data

Get example OSM data
get_osm_streets

Get OpenStreetMap streets
get_osm_river_surface

Get the river surface from OpenStreetMap
get_osm_city_boundary

Get the city boundary from OpenStreetMap
get_stac_asset_urls

Retrieve the URLs of all the assets intersecting a bbox from a STAC API
get_example_cache_filepath

Get file path where to cache example data files
delineate_segments

Split a river corridor into segments
delineate_riverspace

Delineate the space surrounding a river
get_dem_example_data

Get example DEM data
get_slope

Derive slope as percentage from DEM
get_dem

Access digital elevation model (DEM) for a given region
flatten_network

Flatten a network by adding points at apparent intersections
get_cd_char

Get characteristic value of distribution of cost distance
mask_cost_distance

Mask out river regions incl. a buffer in cost distance raster data
load_raster

Load raster data from one or multiple (remote) files
osmdata_as_sf

Retrieve OpenStreetMap data as sf object
mask_slope

Mask slope raster, setting the slope to zero for the pixels overlapping the river area.
match_osm_name

Match OpenStreetMap data by name
get_dem_cache_filepath

Get file path where to cache digital elevation model (DEM) data
nearest_node

Find the node in a network that is closest to a target geometry.
delineate

Delineate a corridor around a river
load_dem

Retrieve DEM data from a list of STAC assets
get_osmdata

Retrieve OpenStreetMap data for a given location
get_utm_zone

Get the UTM zone of a spatial object
get_osmdata_cache_filepath

Get the file path where to cache results of an Overpass API query
set_units_like

Set the units of x as the units of y
initial_edges

Identify the initial edges of the river corridor
shortest_path

Find shortest path between a pair of nodes in the network.
get_valley_polygon

Create vector/polygon representation of valley without holes from raster mask
get_river_aoi

Get an area of interest (AoI) around a river, cropping to the bounding box of a city
get_cost_distance

Derive cost distance function from masked slope
get_intersecting_edges

Identify network edges that are intersecting a geometry
get_example_data_file

Retrieve an example data file from the data repository
select_nonintersecting_lines

Select non-intersecting line segments
get_river_banks

Draw the regions corresponding to the two river banks
river_buffer

Draw a corridor as a fixed buffer region around a river.
osmdata_query

Query the Overpass API for a key:value pair within a bounding box
delineate_corridor

Delineate a river corridor on a spatial network
find_intersections

Find intersections between the edges of two networks
split_by

Split a geometry along a (multi)linestring.
write_data_to_cache

Write data to the cache directory
filter_network

Subset a network keeping the components that intersect a target geometry.
get_osm_bb

Get the bounding box of a city
get_osm_buildings

Get OpenStreetMap buildings
get_osm_railways

Get OpenStreetMap railways
get_osm_river_centerline

Get the river centreline from OpenStreetMap
get_valley_polygon_no_hole

Remove possible holes from valley geometry
reproject

Reproject a raster or vector dataset to the specified coordinate reference system (CRS)
get_valley_polygon_raw

Create vector/polygon representation of valley raster mask
rcrisp-package

rcrisp: Automate the Delineation of Urban River Spaces
read_data_from_cache

Read data from the cache directory
smooth_dem

Spatially smooth dem by (window) filtering
simplify_network

Simplify a spatial network by removing multiple edges and loops.
as_bbox

Get the bounding box from the x object
buffer

Apply a buffer region to a sf object
as_network

Create a network from a collection of line strings
check_cache

Check cache
cache_directory

Return the cache directory used by the package
as_crs

Standardise the coordinate reference system (CRS) of an object
clean_network

Clean a spatial network
delineate_valley

Extract the river valley from the DEM
corridor_edge

Draw a corridor edge on the spatial network.
combine_river_features

Combine river centerline and surface
cap_corridor

Cap the corridor by connecting the edge end points
check_invalid_geometry

Check and fix invalid geometries
default_stac_dem

Default STAC collection
add_weights

Add weights to the network.
clear_cache

Remove cache files
build_river_network

Build a spatial network from river centerlines
corridor_end_points

Find the corridor end points.
bucharest_dambovita

rcrisp example delineation data for Bucharest
clip_and_filter

Clip lines to the extent of the corridor, and select valid segment edges