Opened 4 months ago

Last modified 2 months ago

#3917 new enhancement

r.info|v.info|r3.info|t.info: display map size used on disk

Reported by: neteler Owned by: grass-dev@…
Priority: normal Milestone: 7.8.3
Component: Default Version: svn-trunk
Keywords: r.info, v.info, r3.info, t.info Cc:
CPU: All Platform: All

Description (last modified by neteler)

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).

Change History (8)

comment:1 Changed 4 months ago by neteler

Description: modified (diff)
Summary: r.info|v.info|r3.info|t.info: output map size used on diskr.info|v.info|r3.info|t.info: display map size used on disk

comment:2 Changed 4 months ago by neteler

Here some code which could probably support the implementation:

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

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

comment:3 Changed 4 months ago 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).

comment:4 Changed 4 months ago 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.

comment:5 Changed 4 months ago 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.

comment:6 Changed 3 months ago by neteler

Milestone: 7.8.17.8.2

Ticket retargeted after milestone closed

comment:7 Changed 2 months ago by neteler

Milestone: 7.8.2

Ticket retargeted after milestone closed

comment:8 Changed 2 months ago by neteler

Milestone: 7.8.3
Note: See TracTickets for help on using tickets.