<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p><br>
</p>
<div class="moz-cite-prefix">Le 13/07/2021 à 18:24, Javier Jimenez
Shaw a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:CADRrdKsSeQYBhuGrMMDBU37kY_zLa4jjByw-rzN0v+xzBGLP5g@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>Sounds good.</div>
<div><br>
</div>
<div>My next question is how to write the overviews data
efficiently.</div>
<div>I see that there is a method "GDALRasterBand *
GDALRasterBand::GetOverview ( int i ) ", but for that I need
to deinterlace the image (copying it), and call it 4 times. Is
there any trick I am missing while calling
GDALRasterBand::RasterIO? Maybe some black magic with the
pixel and line spaces? The images/overviews I get from the GPU
are interlaced (RGBARGBA)<br>
</div>
<div>On the other side there is "GDALDataset::RasterIO(...)",
but there is not explicit way to set the overview level.</div>
</div>
</blockquote>
<p>You can call GetDataset() on the RasterBand returned by
GetOverview(). Note that this will not necessarily return a
non-NULL dataset for all drivers, but it will for GeoTIFF.</p>
<p>Internally though this will go through the GDAL block cache (per
band), so there will be internal deinterlace & reinterlace, at
least for internal overviews, that by default use
pixel-interleaving (for external overviews, band interleaving is
used)<br>
</p>
<p><br>
</p>
<blockquote type="cite"
cite="mid:CADRrdKsSeQYBhuGrMMDBU37kY_zLa4jjByw-rzN0v+xzBGLP5g@mail.gmail.com">
<div dir="ltr">
<div><br>
</div>
<div>Thanks<br>
</div>
<div>
<div>
<div dir="ltr" class="gmail_signature"
data-smartmail="gmail_signature">.___ ._ ..._ .. . ._.
.___ .. __ . _. . __.. ... .... ._ .__<br>
Entre dos pensamientos racionales <br>
hay infinitos pensamientos irracionales.<br>
<br>
</div>
</div>
<br>
</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Tue, 13 Jul 2021 at 14:04,
Even Rouault <<a href="mailto:even.rouault@spatialys.com"
moz-do-not-send="true">even.rouault@spatialys.com</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">
<div>
<p>Javier,</p>
<p>You can use the "NONE" resampling method in
BuildOverviews() or gdaladdo to create the overviews IFD
without allocating any storage, and then you can open the
file in update mode to set whatever values you want.
APPEND_SUBDATASET=YES will not set the appropriate value
for the SubFileType TIFF tag, and thus such pages won't be
recognized as overviews</p>
<p>Even<br>
</p>
<div>Le 13/07/2021 à 13:57, Javier Jimenez Shaw a écrit :<br>
</div>
<blockquote type="cite">
<div dir="ltr">
<div>Hi</div>
<div><br>
</div>
<div>I am computing the overviews of a GeoTIFF on my own
(using the GPU, much faster), and I want to include
them in the tif file (also in the ovr sidecar file).</div>
<div>What is the best way to do it? Just creating a
multipage TIFF (I guess with the option
APPEND_SUBDATASET=YES)? Is there anything else needed
(metadata, tiff tags, etc)?</div>
<div><br>
</div>
<div>So far I want to do it in RGBA 8 bit images. (In
the future I want to do it also in float32 images with
nodata value and any number of bands, but no hurry).<br>
</div>
<div><br>
</div>
<div>I am using GDAL 3.3.1</div>
<div><br>
</div>
<div>Any help is welcome.<br>
</div>
<div><br>
</div>
<div>Thanks.</div>
<div>Javier.<br>
</div>
<div>
<div>
<div dir="ltr">.___ ._ ..._ .. . ._. .___ .. __ .
_. . __.. ... .... ._ .__<br>
Entre dos pensamientos racionales <br>
hay infinitos pensamientos irracionales.<br>
<br>
</div>
</div>
</div>
</div>
<br>
<fieldset></fieldset>
<pre>_______________________________________________
gdal-dev mailing list
<a href="mailto:gdal-dev@lists.osgeo.org" target="_blank" moz-do-not-send="true">gdal-dev@lists.osgeo.org</a>
<a href="https://lists.osgeo.org/mailman/listinfo/gdal-dev" target="_blank" moz-do-not-send="true">https://lists.osgeo.org/mailman/listinfo/gdal-dev</a>
</pre>
</blockquote>
<pre cols="72">--
<a href="http://www.spatialys.com" target="_blank" moz-do-not-send="true">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</div>
</blockquote>
</div>
</blockquote>
<pre class="moz-signature" cols="72">--
<a class="moz-txt-link-freetext" href="http://www.spatialys.com">http://www.spatialys.com</a>
My software is free, but my time generally not.</pre>
</body>
</html>