TransWikia.com

Exporting a raster object with a categorical legend

Geographic Information Systems Asked by user36756 on July 30, 2021

I created a raster object (package raster in R) using the function rasterize starting from a shapefile of polygons. I passed as field a shapefile attribute (CODE) containing 37 landuse categories.

This is what I did in code:

myrast <- rasterize(x = shapefile, y = another_raster, field = shapefile$CODE) 

The command converts the categorical variable into numbers from 1 to 37 and correctly create the raster.

Now I want to export the raster to see it in a GIS but I would like that a legend would be shown with the CODE and not with the number from 1 to 37.

How can I do this?

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP