[gdal-dev] vrt guidance: 31 band classified raster

mhw-at-yg matt.wilkie at gov.yk.ca
Fri Oct 4 12:44:18 PDT 2019


> I don't see VRT cascading of any help here, from what I've understood of
your 
> use case. I think you have no other choice than replicating <Category> and 
> <ColorTable> in all <VRTRasterBand>

Ok. Thanks for confirming my understanding.

Next question: It appears that <Category> <ColorTable> are order-of-index
based. Meaning that: if "Evergreen" is first element in the category list it
is matched to the first element in the color list. So there is no way in vrt
to specify a lookup table of style "name == pixel_value" like the below?

  Pixel_Value       Category      
 ------------- ------------------ 
            1   Evergreen Forest  
            2   Deciduous Forest  
          ...                     
           14   Barren            
           15   Water   


I've worked around this by inserting an "n/a" category and 0,0,0 colour
table as first line in each. Without that in qgis and arcmap everything is
shifted by one and 'Deciduous' is assigned to pixel value 1 and 'Water' to
14.

-Matt





-----
-Matt
--
Sent from: http://osgeo-org.1560.x6.nabble.com/GDAL-Dev-f3742093.html


More information about the gdal-dev mailing list