View source: R/overlay.relief.R
overlay.relief | R Documentation |
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.
overlay.relief( map.data, variables, elevation.raster, make.hillshade = TRUE, coordinate.system = NULL, altitude = 45, azimuth = 270, z.factor = NULL )
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. |
A list containing 1. a data frame of points and their associated hill shade values and sf attributes 2. the EPGS projection code
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.