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

Matt.Wilkie at gov.yk.ca Matt.Wilkie at gov.yk.ca
Thu Oct 3 16:01:01 PDT 2019


Hello gdal-dev, it's been a long time!  I'm happy to be digging into raster data building again for a change, but could use some nudges in the right direction(s).

A few weeks ago Nasa released Landsat-derived Annual Dominant Land Cover Across ABoVE Core Domain, 1984-2014<https://daac.ornl.gov/ABOVE/guides/Annual_Landcover_ABoVE.html>.

It's composed of 175 geotiff images, with each file containing 31 bands which in turn correspond to a single year in the 1984-2014 period. Each band is 8bit unsigned integer with values from 1 to 15 and 255 as nodata. Each integer value corresponds to a class such as "Evergreen Forest", "Herbaceous", "Water" and so on.

I've been successful in manually building a VRT file using Category element for the classes and ColorTable entry for a palette - but only for a single band.

My question is: how to properly apply this to all bands? Do I need duplicate category and colortable elements to every single VRTRasterBand element or is there a smart way to define it once and then refer to it like a variable?  Am I even approaching this the right way?

It was quite a bit of work to get this far and I'm not looking forward to doing this 30 more times.

Sample vrt and simplified source is attached.

Matt Wilkie
Geomatics Analyst
Environment | Information Management & Technology
T 867-667-8133 | Yukon.ca<http://yukon.ca/>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20191003/2773f392/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scratch.0.tif
Type: image/tiff
Size: 35454 bytes
Desc: scratch.0.tif
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20191003/2773f392/attachment-0001.tif>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: scratch_manually_built.vrt
Type: application/octet-stream
Size: 20347 bytes
Desc: scratch_manually_built.vrt
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20191003/2773f392/attachment-0001.obj>


More information about the gdal-dev mailing list