<div dir="ltr">Thank you Even for your prompt answer, <span style="font-family:monospace;font-size:12px;white-space:pre-wrap">-co NBITS=16 solved my problem!</span><div><span style="font-family:monospace;font-size:12px;white-space:pre-wrap"><br></span></div><div><span style="font-family:monospace;font-size:12px;white-space:pre-wrap">Thomas</span></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Le mar. 16 juin 2020 à 17:37, Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> a écrit :<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><u></u>
<div style="font-family:monospace;font-size:9pt;font-weight:400;font-style:normal">
<p style="margin:0px;text-indent:0px">> I am puzzled by this behavior... Is there something wrong with my GDAL</p>
<p style="margin:0px;text-indent:0px">> settings ?</p>
<p style="margin:0px;text-indent:0px">> Is there a way to speed up the GeoTIFF creation ? Why is it faster using</p>
<p style="margin:0px;text-indent:0px">> python ?</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">There might be several factors:</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">- if with rasterio you read completely the image into memory, and then write it, parallel decompression is perhaps more effective. gdal_translate (actually the mechanics behind it) tries to use smaller read & write windows by default. You could try to set the GDAL_SWATH_SIZE configuration option to 250000000 so that the full band is read at once.</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">- but I suspect the reason might be due to the Sentinel2 band reporting 15 bits, and gdal_translate instructing the GTiff driver to use that setting, whereas I'm not sure if rasterio does the same by default. Writing 15 bits / pixel isn't a super fast code path in the GeoTIFF driver. You could try adding -co NBITS=16</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">Even</p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px"> </p>
<p style="margin:0px;text-indent:0px">-- </p>
<p style="margin:0px;text-indent:0px">Spatialys - Geospatial professional services</p>
<p style="margin:0px;text-indent:0px"><a href="http://www.spatialys.com" target="_blank">http://www.spatialys.com</a></p></div></blockquote></div>