RiverREM is a Python package for automatically generating river relative elevation model (REM) visualizations from nothing but an input digital elevation model (DEM). The package uses the OpenStreetMap API to retrieve river centerline geometries over the DEM extent. Interpolation of river elevations is automatically handled using a sampling scheme based on raster resolution and river sinuosity to create striking high-resolution visualizations without interpolation artefacts straight out of the box and without additional manual steps. The package also contains a helper class for creating DEM raster visualizations. See the documentation pages for more details.
For more information on REMs and this project see this OpenTopography blog post.
Install via conda:
conda install -c conda-forge riverrem
or clone this repo and create a conda environment from the environment.yml
:
git clone https://github.com/opentopography/RiverREM.git
cd RiverREM
conda env create -n riverrem --file environment.yml
In order to handle dependencies such as GDAL and OSMnx, it is highly recommended to install with conda
instead of pip
for ease of use.
-
Get a DEM for the area of interest. Some sources for free topographic data:
-
Create an REM visualization with default arguments:
from riverrem.REMMaker import REMMaker # provide the DEM file path and desired output directory rem_maker = REMMaker(dem='/path/to/dem.tif', out_dir='/out/dir/') # create an REM rem_maker.make_rem() # create an REM visualization with the given colormap rem_maker.make_rem_viz(cmap='mako_r')
Options for adjusting colormaps, shading, interpolation parameters, and more are detailed in the documentation.
- No river in DEM extent or inaccurate centerline: Use the OSM editor to create/modify river centerline(s). Alternatively, a user-provided centerline can be input to override the OSM centerline. See the documentation for more details.
Submitting issues, bugs, or suggested feature improvements are highly encouraged for this repository.
This is the OpenTopography fork of https://github.com/klarrieu/RiverREM by Kenneth Larrieu. This package was made possible and inspired by the following:
- The beautiful REMs popularized by Daniel Coe
- DahnJ's implementation of REMs using xarray
- Geoff Boeing's OSMnx Python package leveraging the OSM Overpass API
- The UNAVCO Student Internship Program
- The team at OpenTopography for supporting this effort under the following U.S. National Science Foundation award numbers: 1948997, 1948994, 1948857.