<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Dear group,<div><br></div><div>Does the OVERVIEW_LEVEL open option described in <a href="https://www.gdal.org/gdal_vrttut.html#gdal_vrttut_format">https://www.gdal.org/gdal_vrttut.html#gdal_vrttut_format</a> apply to VRT Overview elements? It occurs to me that if it did, we could add external overviews to a dataset using a single VRT file instead of the nested VRTs shown in <a href="https://lists.osgeo.org/pipermail/gdal-dev/2012-July/033299.html">https://lists.osgeo.org/pipermail/gdal-dev/2012-July/033299.html</a>.</div><div><br></div><div>For example, if I have a GeoTIFF with no overviews named cog_novr.tif and another GeoTIFF at half resolution *with* overviews, I could virtually add all those overview levels to the full resolution dataset like this (I think?)</div><div><br></div><div><div><VRTDataset rasterXSize="5080" rasterYSize="5194"></div><div>  <SRS>...</SRS></div><div>  <GeoTransform>...</GeoTransform></div><div>  <VRTRasterBand dataType="UInt16" band="1"></div><div>    <ColorInterp>Gray</ColorInterp></div><div>    <SimpleSource></div><div>      <SourceFilename relativeToVRT="1">cog_novr.tif</SourceFilename></div><div>      <SourceBand>1</SourceBand></div><div>      <SourceProperties RasterXSize="7621" RasterYSize="7791" DataType="UInt16" BlockXSize="512" BlockYSize="512" /></div><div>      <SrcRect xOff="0" yOff="0" xSize="7621" ySize="7791" /></div><div>      <DstRect xOff="0" yOff="0" xSize="5080.22220278191" ySize="5193.55553653945" /></div><div>    </SimpleSource></div><div><br></div><div>    <Overview></div><div>      <!-- First overview is provided by the main image in the TIFF that</div><div>             has all the overviews --></div><div>      <SourceFilename relativeToVRT="1">cog_ovrs.tif</SourceFilename></div><div>      <SourceBand>1</SourceBand></div><div>      <SourceProperties RasterXSize="3810" RasterYSize="3895" DataType="UInt16" BlockXSize="512" BlockYSize="512" /></div><div>      <SrcRect xOff="0" yOff="0" xSize="3810" ySize="3895" /></div><div>      <DstRect xOff="0" yOff="0" xSize="5080.22220278191" ySize="5193.55553653945" /></div><div>    </Overview></div><div><br></div><div>    <Overview></div><div>      <!-- Second overview is provided by the first (index 0) overview of the TIFF that</div><div>             has all the overviews --></div><div>      <SourceFilename relativeToVRT="1">cog_ovrs.tif</SourceFilename></div><div>      <OpenOptions></div><div>        <OOI key="OVERVIEW_LEVEL">0</OOI></div><div>      </OpenOptions></div><div>      <SourceBand>1</SourceBand></div><div>      <SourceProperties RasterXSize="1905" RasterYSize="1948" DataType="UInt16" BlockXSize="512" BlockYSize="512" /></div><div>      <SrcRect xOff="0" yOff="0" xSize="1905" ySize="1948" /></div><div>      <DstRect xOff="0" yOff="0" xSize="5080.22220278191" ySize="5193.55553653945" /></div><div>    </Overview></div><div><br></div><div>  </VRTRasterBand></div><div></VRTDataset></div></div><div><br></div><div>With GDAL 2.2.4, gdalinfo tells me that this VRT has two overviews, but the overview levels reported look suspicious:</div><div><br></div><div><div>Band 1 Block=128x128 Type=UInt16, ColorInterp=Gray</div><div>  Overviews: 3810x3895, 3810x3895</div></div><div><br></div><div>I expected to see a 1905x1948 overview above.</div><div><br></div><div>Should I expect the open option to work? If not, could it be made to work or does that go against the grain of VRT features?</div><div><br></div><div>-- <br><div dir="ltr" class="gmail_signature"><div dir="ltr">Sean Gillies</div></div></div></div></div></div></div></div></div>