Skip to content

find a good way of storing colours for categorical afrilandcover raster #8

@andysouth

Description

@andysouth

I would like the labels and colours for the categorical raster object afrilandcover to be stored in the object so that it is easy for new users to be able to plot them.

The current sub-optimal solution enables this to work in mapview but similar seems not to work in tmap

mapview(afrilandcover, att="landcover", col.regions=levels(afrilandcover)[[1]]$colour)

Here is my unfinished experimentation including trying stars & terra. Ideally I'd like to use stars.

afrilandcover <- ratify(afrilandcover)

If anyone has a good solution for this I'd be very grateful.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions