<div dir="ltr"><div>Merci Even,</div><div>I can confirm that the workaround you suggested works correctly.</div><div>From the performance I was getting beforehand, I strongly believe that the mixup happening on the overview levels was causing my hat/lr dataset to never be used at all.</div><div>Thank you for the quick response, <br></div><div>Thomas<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 22, 2024 at 3:21 PM Even Rouault via gdal-dev <<a href="mailto:gdal-dev@lists.osgeo.org">gdal-dev@lists.osgeo.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Salut Thomas,<br>
<br>
There were actually 2 issues:<br>
<br>
- contrary to what the documentation stated, OVERVIEW_0_xxxx metadata <br>
items were simply ignored, hence you only got overviews starting at the <br>
1/4 reduction<br>
<br>
- and the documentation also lied when implying that it would <br>
automatically add overviews of overview datasets<br>
<br>
Both issues are now fixed per <a href="https://github.com/OSGeo/gdal/pull/10465" rel="noreferrer" target="_blank">https://github.com/OSGeo/gdal/pull/10465</a>.<br>
<br>
You can workaround both issues by:<br>
<br>
- starting your OVERVIEW_{idx} at 1  (this will be compatible of GDAL <br>
3.9.2, that will be tolerant to {idx} starting at 0 or 1)<br>
<br>
- and you can explicitly add overviews of your hat dataset by specifying <br>
OVERVIEW_{idx}_OPEN_OPTIONS=OVERVIEW_LEVEL=NONE to gets its full <br>
resolution, OVERVIEW_{idx+1}_OPEN_OPTIONS=OVERVIEW_LEVEL=0 to get its <br>
first overview, etc. (this will also be compatible of GDAL 3.9.2, since <br>
specifying the OVERVIEW_LEVEL open option prevents other overviews to be <br>
added)<br>
<br>
So something like:<br>
<br>
   OVERVIEW_1_FACTOR=2<br>
   OVERVIEW_2_FACTOR=4<br>
   OVERVIEW_3_FACTOR=8<br>
   OVERVIEW_4_FACTOR=16<br>
   OVERVIEW_5_FACTOR=32<br>
   OVERVIEW_6_FACTOR=64<br>
   OVERVIEW_7_FACTOR=128<br>
   OVERVIEW_8_DATASET=/*snip*/lr.tif<br>
   OVERVIEW_8_OPEN_OPTIONS=OVERVIEW_LEVEL=NONE<br>
   OVERVIEW_9_DATASET=/*snip*/lr.tif<br>
   OVERVIEW_9_OPEN_OPTIONS=OVERVIEW_LEVEL=0<br>
   OVERVIEW_10_DATASET=/*snip*/lr.tif<br>
   OVERVIEW_10_OPEN_OPTIONS=OVERVIEW_LEVEL=1<br>
<br>
Even<br>
<br>
<br>
Hi list,<br>
> I'm experimenting with the GTI driver and hitting an issue when trying <br>
> to add overviews.<br>
> I'm compiling a large number of adjacent non-overlapping tiles, each <br>
> of which has is own bundled overviews:<br>
><br>
> gdalinfo /*snip*/tile-1377-471.tif<br>
><br>
> Size is 32768, 32768<br>
> Origin = (3.057607090103000,48.420794507110998)<br>
> Pixel Size = (0.000004056990000,-0.000002694048000)<br>
> Band 1 Block=512x512 Type=Byte, ColorInterp=Red<br>
>   NoData Value=0<br>
>   Overviews: 16384x16384, 8192x8192, 4096x4096, 2048x2048, 1024x1024, <br>
> 512x512, 256x256<br>
> Band 2 Block=512x512 Type=Byte, ColorInterp=Green<br>
>   NoData Value=0<br>
>   Overviews: 16384x16384, 8192x8192, 4096x4096, 2048x2048, 1024x1024, <br>
> 512x512, 256x256<br>
> Band 3 Block=512x512 Type=Byte, ColorInterp=Blue<br>
>   NoData Value=0<br>
>   Overviews: 16384x16384, 8192x8192, 4096x4096, 2048x2048, 1024x1024, <br>
> 512x512, 256x256<br>
><br>
> I also have a very low resolution "hat" file that covers the whole <br>
> work area:<br>
><br>
> gdalinfo /*snip*/lr.tif<br>
> Size is 2100, 1792<br>
> Origin = (1.413084112150000,49.303580186365998)<br>
> Pixel Size = (0.001045206663490,-0.000689676288000)<br>
> Band 1 Block=256x256 Type=Byte, ColorInterp=Red<br>
>   NoData Value=0<br>
>   Overviews: 1050x896, 525x448, 263x224, 132x112<br>
> Band 2 Block=256x256 Type=Byte, ColorInterp=Green<br>
>   NoData Value=0<br>
>   Overviews: 1050x896, 525x448, 263x224, 132x112<br>
> Band 3 Block=256x256 Type=Byte, ColorInterp=Blue<br>
>   NoData Value=0<br>
>   Overviews: 1050x896, 525x448, 263x224, 132x112<br>
><br>
> I would like to create a GTI dataset referencing all these tiles, and <br>
> the "hat" dataset, and have created it like so:<br>
><br>
> ogrinfo -so -al mosaic.gti.fgb:<br>
><br>
> Layer name: tileindex<br>
> Metadata:<br>
>   BAND_COUNT=3<br>
>   DATA_TYPE=Byte<br>
>   NODATA=0<br>
>   OVERVIEW_0_FACTOR=2<br>
>   OVERVIEW_1_FACTOR=4<br>
>   OVERVIEW_2_FACTOR=8<br>
>   OVERVIEW_3_FACTOR=16<br>
>   OVERVIEW_4_FACTOR=32<br>
>   OVERVIEW_5_FACTOR=64<br>
>   OVERVIEW_6_FACTOR=128<br>
>   OVERVIEW_7_DATASET=/*snip*/lr.tif<br>
>   RESAMPLING=bilinear<br>
>   RESX=0.00000269495773407954<br>
>   RESY=0.00000269495773407954<br>
><br>
> However when I inspect the gti dataset, the overview count is not what <br>
> I expect:<br>
><br>
> gdalinfo mosaic.gti.fgb:<br>
><br>
> Size is 814460, 458598<br>
> Origin = (1.413084000000000,49.303579999999997)<br>
> Pixel Size = (0.000002694957734,-0.000002694957734)<br>
> Band 1 Block=256x256 Type=Byte, ColorInterp=Undefined<br>
>   NoData Value=0<br>
>   Overviews: 203615x114650, 101808x57325, 50904x28663, 25452x14332, <br>
> 12726x7166, 6363x3583, 2100x1792<br>
><br>
> Note the overview list, which I would have expected to be:<br>
><br>
> 407230x229299, 203615x114650, 101808x57325, 50904x28663, 25452x14332, <br>
> 12726x7166, 6363x3583, 2100x1792, 1050x896, 525x448, 263x224, 132x112<br>
><br>
> but is not, i.e. it is missing the first overview level of the <br>
> individual tiles, and the overviews of the hat dataset.<br>
> Is this a configuration issue on my end ?<br>
><br>
> Thanks,<br>
> Thomas<br>
><br>
><br>
><br>
><br>
> _______________________________________________<br>
> gdal-dev mailing list<br>
> <a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
> <a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
<br>
-- <br>
<a href="http://www.spatialys.com" rel="noreferrer" target="_blank">http://www.spatialys.com</a><br>
My software is free, but my time generally not.<br>
<br>
_______________________________________________<br>
gdal-dev mailing list<br>
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank">gdal-dev@lists.osgeo.org</a><br>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" rel="noreferrer" target="_blank">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a><br>
</blockquote></div>