Skip to contents

The slope_z*() functions calculate summary values for the Z axis in sfc objects with XYZ geometries.

Usage

z_value(x)

z_start(x)

z_end(x)

z_mean(x)

z_max(x)

z_min(x)

z_elevation_change_start_end(x)

z_direction(x)

z_cumulative_difference(x)

Arguments

x

An sfc object with \'XYZ\' coordinates

Value

A vector of numeric values representing elevations associated with simple feature geometries that have elevations (XYZ coordinates).

A numeric vector of length 1 representing the first Z coordinate.

A numeric vector of length 1 representing the last Z coordinate.

A numeric vector of length 1 representing the mean of Z coordinates.

A numeric vector of length 1 representing the maximum of Z coordinates.

A numeric vector of length 1 representing the minimum of Z coordinates.

A numeric vector of length 1 representing the difference between the last and first Z coordinates.

A numeric vector of length 1 representing the sign of the difference between the last and first Z coordinates.

A numeric vector of length 1 representing the sum of absolute differences between consecutive Z coordinates.

Examples

if (rlang::is_installed("sf")) {
  x = slopes::lisbon_route_3d
  x
  z_value(x)[1:5]
  xy = slopes::lisbon_route
  try(z_value(xy)) # error message
  z_start(x)
  z_end(x)
  z_direction(x)
  z_elevation_change_start_end(x)
  z_direction(x)
  z_cumulative_difference(x)
}
#> Error in z_value(xy) : 
#>   Requires object that have XYZ geometries, see ?slope_raster.
#> [1] 196.9088