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

Stephen Woodbridge stephenwoodbridge37 at gmail.com
Thu Oct 3 16:43:55 PDT 2019


Matt,

Have you tried create a cascading VRT, where the first VRT composites 
all the GTiff files into a single virtual raster and then reference the 
composite in another VRT that assigns colortable. I think this should 
work nicely.

-Steve W

On 10/3/2019 7:01 PM, Matt.Wilkie at gov.yk.ca wrote:
>
> 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/>
>
>
> _______________________________________________
> gdal-dev mailing list
> gdal-dev at lists.osgeo.org
> https://lists.osgeo.org/mailman/listinfo/gdal-dev


---
This email has been checked for viruses by Avast antivirus software.
https://www.avast.com/antivirus



More information about the gdal-dev mailing list