[GRASS-dev] [GRASS GIS] #3917: r.info|v.info|r3.info|t.info: output map size used on disk

#3917: r.info|v.info|r3.info|t.info: output map size used on disk
---------------------------------------------+-------------------------
Reporter: neteler | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.8.1
Component: Default | Version: svn-trunk
Keywords: r.info, v.info, r3.info, t.info | CPU: All
Platform: All |
---------------------------------------------+-------------------------
At time it is difficult to estimate the disk usage of map in GRASS GIS.
Especially, because one map consists of several files.

An additional entry in r.info|v.info|r3.info|t.info output would be very
useful (think about storage consumption estimation and billing in a cloud
environment).

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3917&gt;
GRASS GIS <https://grass.osgeo.org>

#3917: r.info|v.info|r3.info|t.info: display map size used on disk
--------------------------+---------------------------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.8.1
Component: Default | Version: svn-trunk
Resolution: | Keywords: r.info, v.info, r3.info, t.info
       CPU: All | Platform: All
--------------------------+---------------------------------------------
Description changed by neteler:

Old description:

At time it is difficult to estimate the disk usage of map in GRASS GIS.
Especially, because one map consists of several files.

An additional entry in r.info|v.info|r3.info|t.info output would be very
useful (think about storage consumption estimation and billing in a cloud
environment).

New description:

At time it is difficult to estimate the disk usage of map in GRASS GIS.
Especially, because one map consists of several files.

An additional entry in the output of r.info|v.info|r3.info|t.info would be
very useful (use case: think about estimation of storage consumption and
billing in a cloud environment).

--

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3917#comment:1&gt;
GRASS GIS <https://grass.osgeo.org>

#3917: r.info|v.info|r3.info|t.info: display map size used on disk
--------------------------+---------------------------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.8.1
Component: Default | Version: svn-trunk
Resolution: | Keywords: r.info, v.info, r3.info, t.info
       CPU: All | Platform: All
--------------------------+---------------------------------------------

Comment (by neteler):

Here some code which could probably support the implementation:

* https://github.com/OSGeo/grass-
addons/blob/master/grass7/general/g.compare.md5/g.compare.md5.py

For SQLite table sizes (apparently not easy to obtain):

* https://stackoverflow.com/questions/27572387/query-that-returns-the-
size-of-a-table-in-a-sqlite-database#36627097

Hence (https://www.sqlite.org/dbstat.html):
{{{
sqlite3 nc_spm_08_grass7/PERMANENT/sqlite/sqlite.db

# page size
sqlite> SELECT SUM("pgsize") FROM "dbstat" WHERE name='zipcodes_wake';
5120
sqlite> SELECT SUM("pgsize") FROM "dbstat" WHERE name='roadsmajor';
12288
}}}

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3917#comment:2&gt;
GRASS GIS <https://grass.osgeo.org>

#3917: r.info|v.info|r3.info|t.info: display map size used on disk
--------------------------+---------------------------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.8.1
Component: Default | Version: svn-trunk
Resolution: | Keywords: r.info, v.info, r3.info, t.info
       CPU: All | Platform: All
--------------------------+---------------------------------------------

Comment (by mmetz):

Regarding raster maps, a better place to report disk usage would be
r.compress, because with r.compress you could test which compression
method is most appropriate for your use case (trade-off between disk usage
and IO speed).

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3917#comment:3&gt;
GRASS GIS <https://grass.osgeo.org>

#3917: r.info|v.info|r3.info|t.info: display map size used on disk
--------------------------+---------------------------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.8.1
Component: Default | Version: svn-trunk
Resolution: | Keywords: r.info, v.info, r3.info, t.info
       CPU: All | Platform: All
--------------------------+---------------------------------------------

Comment (by neteler):

Well, agreed: r.compress might be another good place.

At time I need to check already existing maps (time series and tiles of
mosaics), so r.info seems to be most appropriate.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3917#comment:4&gt;
GRASS GIS <https://grass.osgeo.org>

#3917: r.info|v.info|r3.info|t.info: display map size used on disk
--------------------------+---------------------------------------------
  Reporter: neteler | Owner: grass-dev@…
      Type: enhancement | Status: new
  Priority: normal | Milestone: 7.8.1
Component: Default | Version: svn-trunk
Resolution: | Keywords: r.info, v.info, r3.info, t.info
       CPU: All | Platform: All
--------------------------+---------------------------------------------

Comment (by mmetz):

Thinking about it, r.info seems more appropriate.

In any case you should really use r.compress with different compression
methods to decide on the compression method appropriate for your needs.
r.compress also reports changes in disk usage when re-compressing.

Another easy way to estimate disk usage is the file size of the output of
`[r|v].pack -c`.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3917#comment:5&gt;
GRASS GIS <https://grass.osgeo.org>