I've created a raster object x in R, which is a categorical classification. I've used levels(x) <- RAT
with a properly formatted raster attribute table to give the categories names, and then used writeRaster to export to GeoTIFF.
Running gdalinfo on the tiff, I can see the categories in the band information. Looks like:
Band 1 Block=799x5 Type=Int16, ColorInterp=Gray
Min=1.000 Max=5.000
Minimum=1.000, Maximum=5.000, Mean=2.364, StdDev=2.147
NoData Value=-9999
Categories:
0:
1: typeA
2: typeB
3: typeC
4: typeD
5: typeE
Metadata:
STATISTICS_MAXIMUM=5
STATISTICS_MEAN=2.364214323665
STATISTICS_MINIMUM=1
STATISTICS_STDDEV=2.1472654314354
So that's great, but QGIS can't seem to access that category info when I'm styling the layer. Is that even possible? They should act as legend labels.