ProcessSpace

Adam Cummings (USFS),

A package to process Lidar to visualize stream channels flow paths.

Description

This process space tool automates a detailed catchment-level assessment of streams and channels using LiDAR-derived DEMs to enable visualization of flow path anomalies and restoration opportunities not easily observed in the field or using conventional maps. From steep tributaries to the valley bottom, flow paths can be assessed to determine if they were degraded, ditched, or if flow paths had been redirected or constricted due to current or historical roads or other disturbances. This information can be used to restore natural flow paths with high precision interventions to restore stream function, reduce need for road and culvert repair, and restore downstream valley-bottom habitats.

Outputs include topographical cross-sections, process space polygons at configurable stage levels (default 1 m and 2 m above the baseline water surface at time of LiDAR), and color-coded detrended elevation models, all of which can be visualized three-dimensionally in Google Earth using the KMZ file output.

Installation

Install the package as follows:

install.packages('remotes')
remotes::install_github('adamkc/ProcessSpace')
library(ProcessSpace)

The package runs on the modern R spatial stack (sf, terra, ggplot2); all dependencies install from CRAN. Satellite basemaps come from Esri World Imagery tiles — no API key required.

Inputs

  1. Digital Terrain Model
  2. Target Stream Reach

Outputs

  1. Algorithmic cross sections
  2. Process Space delineation
  3. Report export
  4. Detrended elevations
  5. A mindset that extends beyond the meadow surface

Example Code:

The example below will produce a PDF report and a KMZ file to load into Google Earth.

library(ProcessSpace)

#Filepath to raster DEM (change to your own file):
rasterLocation <- system.file("external/raster.tif", package="ProcessSpace")
#Filepath to stream shapefile (change to your own file):
streamLocation <- system.file("external/streams.shp", package="ProcessSpace")
streams <- sf::read_sf(streamLocation)
#Pick a target stream for analysis: (`LINKNO` is the FID in this shapefile)
targetStream <- streams %>% dplyr::filter(LINKNO %in% c(12,20))

processSpace(targetStream,
             rasterDir = rasterLocation,
             streamDir = streamLocation,
             outputFilename = "exampleOutput.pdf",
             stageLevels = c(1, 2),                         # stage rises (m) to delineate
             xSectionDensity = units::as_units(20, "m"),    # cross-section spacing
             xSectionLength = units::as_units(100, "m"),    # cross-section half-width
             cut1Dir = "W")                                 # direction of the upstream end

Compare detrending methods (cross-section interpolation vs. the classic stream-line REM vs. a polynomial geomorphic gradeline):

transectObject <- processSpace(targetStream, rasterDir = rasterLocation,
                               outputFilename = "run.pdf",
                               doExportSpatial = FALSE)
compareDetrendMethods(transectObject, sectionName = "run", exportKmz = TRUE)
Example image from Google Earth
Example image from Google Earth