<div dir="auto">Thanks guys for clarification!</div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Wed, Sep 4, 2019, 5:53 PM Even Rouault <<a href="mailto:even.rouault@spatialys.com">even.rouault@spatialys.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On mercredi 4 septembre 2019 17:26:14 CEST Denis Rykov wrote:<br>
> Thanks for quick reply, I've uploaded grib file here:<br>
> <a href="https://transfer.sh/5JCVX/download.grib" rel="noreferrer noreferrer" target="_blank">https://transfer.sh/5JCVX/download.grib</a><br>
<br>
Turns out that my guess wasn't so bad after all. The uncompressed file size is<br>
3601x1801x14(bands)x8(bytes_per_pixel) = 693 MB<br>
whereas a GRIB dataset has an internal cache by default of only 100 MB.<br>
As you write to a pixel-interleaved GTiff, there's constant back and forth <br>
between bands when reading chunks and thus the GRIB cache has no effect.<br>
So 2 possible workarounds:<br>
- increase GRIB_CACHEMAX to 1000 for example. Limited to a GRIB dataset that <br>
can fits uncompressed in memory.<br>
- add "-co interleave=band" to generate a band-interleaved geotiff. That one <br>
can work with an arbitrarily large GRIB file<br>
<br>
I've committed an improvement, so if you now row master with --debug on, <br>
you'll see a hint<br>
"""<br>
GRIB: Maximum band cache size reached for this dataset. Caching only one band <br>
at a time from now, which can negatively affect performance. Consider <br>
increasing GRIB_CACHEMAX to a higher value (in MB), at least 693 in that <br>
instance<br>
"""<br>
<br>
As far as I can see in <br>
<a href="https://github.com/mapbox/rasterio/blob/" rel="noreferrer noreferrer" target="_blank">https://github.com/mapbox/rasterio/blob/</a><br>
e1c984bf0e4a18e039569bb3bafe6667bb5b3a69/rasterio/rio/convert.py#L76<br>
it presumably ingest the whole dataset into memory (Sean, correct me if I'm <br>
wrong), and thus those caching issues don't trigger since the input dataset <br>
will be read band-per-band.<br>
<br>
Even<br>
<br>
-- <br>
Spatialys - Geospatial professional services<br>
<a href="http://www.spatialys.com" rel="noreferrer noreferrer" target="_blank">http://www.spatialys.com</a><br>
</blockquote></div>