Package: slopes 1.0.1.9000

Robin Lovelace

slopes: Calculate Slopes of Roads, Rivers and Trajectories

Calculates the slope (longitudinal gradient or steepness) of linear geographic features such as roads (for more details, see Ariza-López et al. (2019) <doi:10.1038/s41597-019-0147-x>) and rivers (for more details, see Cohen et al. (2018) <doi:10.1016/j.jhydrol.2018.06.066>). It can use local Digital Elevation Model (DEM) data or download DEM data via the 'ceramic' package. The package also provides functions to add elevation data to linestrings and visualize elevation profiles.

Authors:Robin Lovelace [aut, cre, cph], Rosa Félix [aut], Joey Talbot [aut], Gonçalo Matos [aut], Dan Olner [rev], Andy Teucher [rev]

slopes_1.0.1.9000.tar.gz
slopes_1.0.1.9000.zip(r-4.6)slopes_1.0.1.9000.zip(r-4.5)slopes_1.0.1.9000.zip(r-4.4)
slopes_1.0.1.9000.tgz(r-4.5-any)slopes_1.0.1.9000.tgz(r-4.4-any)
slopes_1.0.1.9000.tar.gz(r-4.6-any)slopes_1.0.1.9000.tar.gz(r-4.5-any)
slopes_1.0.1.9000.tgz(r-4.5-emscripten)
slopes.pdf |slopes.html
slopes/json (API)
NEWS

# Install 'slopes' in R:
install.packages('slopes', repos = c('https://packages.ropensci.org', 'https://cloud.r-project.org'))

Reviews:rOpenSci Software Review #420

Bug tracker:https://github.com/ropensci/slopes/issues

Pkgdown site:https://docs.ropensci.org

Datasets:

On CRAN:

Conda:

8.44 score 71 stars 43 scripts 146 downloads 19 exports 20 dependencies

Last updated from:1ff703b855 (on master). Checks:10 OK. Indexed: yes.

TargetResultTotal timeArtifact
linux-devel-x86_64OK184
pkgdown docsOK227
source / vignettesOK316
linux-release-x86_64OK175
macos-release-arm64OK84
macos-oldrel-arm64OK135
windows-develOK126
windows-releaseOK143
windows-oldrelOK135
wasm-releaseOK158

Exports:elevation_addelevation_extractelevation_getplot_dzplot_slopesequential_distslope_distanceslope_distance_meanslope_distance_weightedslope_matricesslope_matrixslope_matrix_meanslope_matrix_to_rasterslope_matrix_weightedslope_rasterslope_vectorslope_xyzslope_xyz_simpleslopes_palette

Dependencies:classclassIntcolorspaceDBIe1071geodistKernSmoothlatticemagrittrMASSpbapplyproxyrasterRcpps2sfspterraunitswk

An introduction to slopes

Rendered fromintro-to-slopes.Rmdusingknitr::rmarkdownon Sep 12 2025.

Last update: 2025-05-29
Started: 2021-08-24

Benchmarking slopes calculation

Rendered frombenchmark.Rmdusingknitr::rmarkdownon Sep 12 2025.

Last update: 2021-09-27
Started: 2021-06-21

Example: gradients of a road network for a given city

Rendered fromroadnetworkcycling.Rmdusingknitr::rmarkdownon Sep 12 2025.

Last update: 2025-05-29
Started: 2021-06-21

Get started

Rendered fromslopes.Rmdusingknitr::rmarkdownon Sep 12 2025.

Last update: 2025-09-12
Started: 2020-05-05

Verification of slopes

Rendered fromverification.Rmdusingknitr::rmarkdownon Sep 12 2025.

Last update: 2025-05-29
Started: 2020-05-06

Readme and manuals

Help Manual

Help pageTopics
Cycle route datacyclestreets_route
Lisbon elevation rasterdem_lisbon_raster
Extract distance and elevation data from routedistance_z
Add elevation data to route linestringselevation_add
Extract elevation values from coordinateselevation_extract
Get elevation data for routeselevation_get
Lisbon road networklisbon_road_network
Lisbon road segmentlisbon_road_segment
Lisbon road segment 3Dlisbon_road_segment_3d
Lisbon road segment XYZlisbon_road_segment_xyz_mapbox
Lisbon route datalisbon_route
Lisbon route 3Dlisbon_route_3d
Lisbon route XYZlisbon_route_xyz_mapbox
Magnolia coordinatesmagnolia_xy
Create slope breaks for color mappingmake_breaks
Assign colors to slope valuesmake_colz
Create color palette for slope visualizationmake_pal
Plot distance-elevation profile with slope coloringplot_dz
Plot elevation profile with slope coloringplot_slope
Calculate sequential distances between pointssequential_dist
Extract midpoint and extent from routes in lonlatsf_mid_ext_lonlat
Calculate slopes using distance dataslope_distance
Calculate mean slope using distance weightingslope_distance_mean
Calculate distance-weighted slopesslope_distance_weighted
Calculate slopes for multiple coordinate matricesslope_matrices
Calculate slopes from coordinate matrixslope_matrix
Calculate mean slope from coordinate matrixslope_matrix_mean
Convert slope matrix to rasterslope_matrix_to_raster
Calculate weighted slopes from coordinate matrixslope_matrix_weighted
Calculate slopes using raster elevation dataslope_raster
Calculate slopes from vector dataslope_vector
Calculate slopes from XYZ coordinate dataslope_xyz
Extract XYZ coordinates from raster or matrixslope_xyz_simple
Get color palette for slopes visualizationslopes_palette