Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I think maybe the Feature_class_name was something specific to the .gdb file I was working with... you might need to replace it with a different name? Not sure as it's been a while.
there is one other issue: if I want to go the rats(x) route, the Land.Cover.Class column is coerced from a factor to numeric. I worked around this by first coercing it to character before calling rats(x) <- lev but just wanted to call it to your attention.
Thanks for the workaround. This may not be related, but I have not been able to write the raster to a GeoTIFF. I get a segfault error when I call writeRaster(x, 'test.tif'). I have tried it on GDAL 2.2.2 and 3.0.4 and get the same error: caught segfault, memory not mapped.
Thanks, very helpful. The other piece of it is that the attribute table of the .grd raster also contains columns Red,Green,Blue, and Opacity that are used in the default plot() method to color the land cover classes appropriately. Is that feature implemented in terra?