<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On 6 September 2016 at 15:23, Markus Metz <span dir="ltr"><<a href="mailto:markus.metz.giswork@gmail.com" target="_blank">markus.metz.giswork@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Sep 6, 2016 at 1:44 PM, Markus Neteler <<a href="mailto:neteler@osgeo.org">neteler@osgeo.org</a>> wrote:<br>
> Hi,<br>
><br>
> since my local drive was filled up again :) I checked raster how data are<br>
> currently compressed in GRASS GIS 7.2.svn.<br>
> According to<br>
><br>
> <a href="https://grass.osgeo.org/grass72/manuals/r.compress.html#used-compression-algorithms" rel="noreferrer" target="_blank">https://grass.osgeo.org/<wbr>grass72/manuals/r.compress.<wbr>html#used-compression-<wbr>algorithms</a><br>
><br>
> all maps are DEFLATE compressed by default:<br>
><br>
> "Raster maps are by default ZLIB compressed.<br>
> ...<br>
><br>
> Floating point (FCELL, DCELL) raster maps never use RLE compression; they<br>
> are either compressed with ZLIB, LZ4, BZIP2 or are uncompressed.<br>
> "<br>
><br>
> Ehm, now how *are* FCELL, DCELL compressed by default? Not quite clear to<br>
> me! This document needs improvements.<br>
<br>
</span>The manual says, as you cited:<br>
<span class="">"Raster maps are by default ZLIB compressed."<br>
</span>What exactly is unclear about this? Should it say "All raster maps ..." ?<br>
<div><div class="h5"><br>
><br>
> Reality check with Sentinel-2 data (3 different bands, same regional<br>
> extent):<br>
><br>
> GRASS 7.2.svn (utm37n):~ > <a href="http://r.info" rel="noreferrer" target="_blank">r.info</a> -r s2_20151225_B02_10m<br>
> min=0<br>
> max=22937<br>
> GRASS 7.2.svn (utm37n):~ > <a href="http://r.info" rel="noreferrer" target="_blank">r.info</a> -r s2_20151225_B04_10m<br>
> min=0<br>
> max=18849<br>
> GRASS 7.2.svn (utm37n):~ > <a href="http://r.info" rel="noreferrer" target="_blank">r.info</a> -r s2_20151225_B8A_20m<br>
> min=0<br>
> max=17210<br>
><br>
> GRASS 7.2.svn (utm37n):~ >:~ > r.compress s2_20151225_B02_10m -p<br>
> <s2_20151225_B02_10m> is compressed (method 2: ZLIB). Data type:<br>
> CELL<br>
><br>
> GRASS 7.2.svn (utm37n):~ >:~ > r.compress s2_20151225_B04_10m -p<br>
> <s2_20151225_B04_10m> is compressed (method 2: ZLIB). Data type:<br>
> CELL<br>
><br>
> GRASS 7.2.svn (utm37n):~ >:~ > r.compress s2_20151225_B8A_20m -p<br>
> <s2_20151225_B8A_20m> is compressed (method 2: ZLIB). Data type:<br>
> CELL<br>
><br>
> So far so nice. Now the suprising part, while the channels are not identical<br>
> (obviously, since covering different spectral parts), the map sizes are<br>
> identical!<br>
><br>
> GRASS 7.2.svn (utm37n):~ > ls -la<br>
> ...<br>
> -rw-r--r--  1 neteler neteler 2539235691 Jun 14 17:14 s2_20151225_B02_10m<br>
> -rw-r--r--  1 neteler neteler 2539235691 Jun 14 17:19 s2_20151225_B03_10m<br>
> -rw-r--r--  1 neteler neteler 2539235691 Jun 14 17:25 s2_20151225_B04_10m<br>
> -rw-r--r--  1 neteler neteler  634878630 Jun 14 20:36 s2_20151225_B05_20m<br>
> -rw-r--r--  1 neteler neteler  634878630 Jun 14 20:37 s2_20151225_B06_20m<br>
> -rw-r--r--  1 neteler neteler  634878630 Jun 14 20:39 s2_20151225_B07_20m<br>
> -rw-r--r--  1 neteler neteler  634878630 Jun 14 20:40 s2_20151225_B11_20m<br>
> -rw-r--r--  1 neteler neteler  634878630 Jun 14 20:42 s2_20151225_B12_20m<br>
> -rw-r--r--  1 neteler neteler  634878630 Jun 14 20:43 s2_20151225_B8A_20m<br>
><br>
> I would expect different sizes, compression can hardly lead to identical<br>
> file sizes.<br>
<br>
</div></div>The default ZLIB compression level was invalid, causing ZLIB to not<br>
compress at all. Fixed in r69387,8.<br>
<br>
Markus M<br>
<span class=""><br>
><br>
> Next test: gzip the file<br>
><br>
> GRASS 7.2.svn (utm37n):~/grassdata/utm37n/<wbr>PERMANENT/cell > ls -la<br>
> s2_20151225_B03_10m<br>
> -rw-r--r-- 1 mneteler mneteler 2539235691 Jun 14 17:19 s2_20151225_B03_10m<br>
><br>
> GRASS 7.2.svn (utm37n):~/grassdata/utm37n/<wbr>PERMANENT/cell > gzip<br>
> s2_20151225_B03_10m<br>
><br>
> GRASS 7.2.svn (utm37n):~/grassdata/utm37n/<wbr>PERMANENT/cell > ls -la<br>
> s2_20151225_B03_10m.gz<br>
> -rw-r--r-- 1 mneteler mneteler 1456248453 Jun 14 17:19<br>
> s2_20151225_B03_10m.gz<br>
><br>
> R<br>
>> 1456248453/2539235691<br>
> [1] 0.5734987<br>
><br>
> Quite smaller! So I am not at all convinced that these CELL files are<br>
> currently ZLIB compressed.<br>
<br>
</span>Compressing a whole file instead of compressing each row separately<br>
(GRASS reads and writes raster data row by row) can lead to higher<br>
compression ratios.<br></blockquote><div><br></div><div>This brings to a long time amount of discussions about parallelization speed-ups of raster functions being limited by the row-based I/O of GRASS. Maybe we should look into this for GRASS8...<br></div><div> <br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<span class="im HOEnZb"><br>
><br>
> From this ticket I would expect something else:<br>
> <a href="https://trac.osgeo.org/grass/ticket/2349" rel="noreferrer" target="_blank">https://trac.osgeo.org/grass/<wbr>ticket/2349</a><br>
><br>
> Ah, and no specific environment variables are set:<br>
><br>
> GRASS 7.2.svn (utm37n):~ > echo $GRASS_<tab><br>
> $GRASS_ADDON_BASE   $GRASS_GNUPLOT    $GRASS_HTML_BROWSER  $GRASS_PAGER<br>
> $GRASS_PROJSHARE    $GRASS_PYTHON     $GRASS_VERSION<br>
><br>
><br>
> A bug?<br>
><br>
> Markus<br>
><br>
</span><div class="HOEnZb"><div class="h5">> ______________________________<wbr>_________________<br>
> grass-dev mailing list<br>
> <a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/grass-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/grass-dev</a><br>
______________________________<wbr>_________________<br>
grass-dev mailing list<br>
<a href="mailto:grass-dev@lists.osgeo.org">grass-dev@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-dev" rel="noreferrer" target="_blank">http://lists.osgeo.org/<wbr>mailman/listinfo/grass-dev</a></div></div></blockquote></div><br><br clear="all"><br>-- <br><div class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><div dir="ltr"><div><div>Yann Chemin<br>Skype/FB: yann.chemin<br></div></div><br></div></div></div></div>
</div></div>