[gdal-dev] Storing mask as part of the *.ovr file
Even Rouault
even.rouault at spatialys.com
Wed Apr 22 03:09:37 PDT 2020
On mardi 21 avril 2020 23:54:03 CEST Denis Rykov wrote:
> Hello,
>
> I'm using *.vrt file that is built atop of COG rasters with internal mask
> (PER_DATASET) + external overview file *.vrt.ovr.
> These files are stored on Azure Blob Storage and I get access to them using
> /vsiaz scheme.
> I've found out that when I read data from this VRT GDAL does few requests
> to *.vrt.ovr to get data and lots of requests to TIFFs to extract a mask.
>
> What are the ways to overcome this? I hope I can put mask into
> sidecar *.vrt.msk file. Is that correct?
> Is there a way to store a mask inside a *.vrt.ovr file?
Hum, given a rgbmask.vrt that has a mask band, the following probably works
gdal_translate rgbmask.vrt rgb_with_external_msk.vrt -b 1 -b 2 -b 3 -of VRT
gdal_translate rgbmask.vrt rgb_with_external_msk.vrt.msk -b mask -of VRT -mo INTERNAL_MASK_FLAGS_1=2 -mo INTERNAL_MASK_FLAGS_2=2 -mo INTERNAL_MASK_FLAGS_3=2
gdaladdo rgb_with_external_msk.vrt.msk
You could probably avoid rgb_with_external_msk.vrt referencing rgbmask.vrt, by making it directly refer to your COG sources.
Even
--
Spatialys - Geospatial professional services
http://www.spatialys.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20200422/3fb0d3e4/attachment.html>
More information about the gdal-dev
mailing list