R: Calculate Terrain Color Map

height_shade {rayshader} | R Documentation

## Calculate Terrain Color Map

### Description

Calculates a color for each point on the surface using a direct elevation-to-color mapping.

### Usage

    height_shade(heightmap, texture = grDevices::terrain.colors(256))

### Arguments

`heightmap` | A two-dimensional matrix, where each entry in the matrix is the elevation at that point.
`texture` | Default 'terrain.colors(256)'. A color palette for the plot.

### Value

RGB array of hillshaded texture mappings.

### Examples

    #Create a direct mapping of elevation to color:
    montereybay %>%
     height_shade() %>%
     plot_map()

    #Add a shadow:

    montereybay %>%
     height_shade() %>%
     add_shadow(ray_shade(montereybay,zscale=50),0.3) %>%
     plot_map()

    #Change the palette:

    montereybay %>%
     height_shade(texture = topo.colors(256)) %>%
     add_shadow(ray_shade(montereybay,zscale=50),0.3) %>%
     plot_map()

    #Really change the palette:

    montereybay %>%
     height_shade(texture = rainbow(256)) %>%
     add_shadow(ray_shade(montereybay,zscale=50),0.3) %>%
     plot_map()

[Package rayshader version 0.19.2 Index]