slope_xyz | R Documentation |
The function takes a sf object with 'XYZ' coordinates and returns a vector of numeric values representing the average slope of each linestring in the sf data frame input.
slope_xyz(
route_xyz,
fun = slope_matrix_weighted,
lonlat = TRUE,
directed = FALSE
)
route_xyz |
An |
fun |
The slope function to calculate per route,
|
lonlat |
Are the coordinates in lon/lat order? TRUE by default |
directed |
Should the value be directed? |
The default function to calculate the mean slope is slope_matrix_weighted()
.
You can also use slope_matrix_mean()
from the package or any other
function that takes the same inputs as these functions not in the package.
A vector of slopes equal in length to the number simple features (rows representing linestrings) in the input object.
route_xyz = lisbon_road_segment_3d
slope_xyz(route_xyz, lonlat = FALSE)
slope_xyz(route_xyz$geom, lonlat = FALSE)
slope_xyz(route_xyz, lonlat = FALSE, directed = TRUE)
slope_xyz(route_xyz, lonlat = FALSE, fun = slope_matrix_mean)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.