overlay.relief: overlay relief with coloured data visualization

View source: R/overlay.relief.R

overlay.reliefR Documentation

overlay relief with coloured data visualization

Description

overlay.relief converts DEM data into a data frame of spatial points and their associated hill shade values. It merges this data with attributes associated with sf geometries. This allows you to visualize sf attributes on top of a shaded relief in ggplot without masking the relief.

Usage

overlay.relief(
  map.data,
  variables,
  elevation.raster,
  make.hillshade = TRUE,
  coordinate.system = NULL,
  altitude = 45,
  azimuth = 270,
  z.factor = NULL
)

Arguments

map.data

An sf data frame with geometries of type POLYGON or MULTIPOLYGON and associated attributes.

variables

The column names of the attributes you wish to visualize as a character vector i.e c("variable_1","variable_2").

elevation.raster

Digital Elevation Model (if make.hillshade = TRUE) or Shaded Relief (if make.hollshade = FALSE) data of class RasterLayer.

make.hillshade

Set to TRUE if you wish to turn DEM data into hillshade, set to FALSE if you wish to pass a hillshade raster to the function directly. Default TRUE.

coordinate.system

EPSG code of the projection you wish to use. Default NULL: if crs of map.data and elevation.raster do not match the latter will be projected to the crs of the former.

altitude

Elevation angle of light source in degrees to calculate hill shade. Numeric value between 0 and 90.

azimuth

Direction angle of light source in degrees to calculate hill shade. Numeric value between 0 and 360.

z.factor

Numeric value to multiply elevation raster by to exaggerate relief. Default NULL.

Value

A list containing 1. a data frame of points and their associated hill shade values and sf attributes 2. the EPGS projection code


till-tietz/rrelief documentation built on Sept. 5, 2022, 7:41 p.m.