Using a hillshade and the height map, generates a semi-transparent hillshade to layer onto an existing map.

generate_altitude_overlay(
heightmap,
start_transition,
end_transition = NULL,
lower = TRUE
)

## Arguments

heightmap

A two-dimensional matrix, where each entry in the matrix is the elevation at that point. All grid points are assumed to be evenly spaced.

start_transition

Elevation above which hillshade is completely transparent.

end_transition

Default NULL. Elevation below which hillshade is completely opaque. By default, this is equal to start_transition.

lower

Default TRUE. This makes hillshade completely opaque below start_transition. If FALSE, the direction will be reversed.

## Value

4-layer RGB array representing the semi-transparent hillshade.

## Examples

#Create a bathymetric hillshade
water_palette = colorRampPalette(c("darkblue", "dodgerblue", "lightblue"))(200)
bathy_hs = height_shade(montereybay, texture = water_palette)
plot_map(bathy_hs)
}

#Set everything below 0m to water palette
montereybay %>%
plot_map()
}

#Add snow peaks by setting lower = FALSE
snow_palette = "white"
snow_hs = height_shade(montereybay, texture = snow_palette)