Skip to content

How can I map numbers to colours with raster?

1 message · Barry Rowlingson

#
On Mon, Oct 29, 2012 at 9:13 AM, Jonsson <amen.alyaari at bordeaux.inra.fr> wrote:
The raster package can handle categorical rasters, but it seems
poorly documented.

 If I read in a categorical raster (land cover classification from
CORINE) then I get a raster that plots using the colour table defined
in the GeoTIFF. This comes from a 'legend' attribute which the raster
object has. This is an undocumented object of class ".RasterLegend".

 I think Robert "Raster" Hijmans has been meaning to document all this
at some point, I've been meaning to dig into it too. Its probably
worth asking further questions on R-sig-geo.

Barry