[GRASS-user] size (in disk) of a raster map

Glynn Clements glynn at gclements.plus.com
Thu Jan 21 05:15:30 EST 2010


Milton Cezar Ribeiro wrote:

> How can I know the size occupied by one raster map?
> The 2G size limit for each map consider the sum of
> all files that is part of the map, or for each individual
> file?

It's for a single file.

> I just created a map=null() using r.mapcalc, and the
> ..\newLocation\PERMANENT\cell_misc\myMap\null
> file is about 1.6GB. If I update my map with
> non-null values, the \cell_misc\myMap\null file
> will increase or decrese (I suspect will decrease)?

The size of the cell_misc/<mapname>/null file depends only upon the
number of rows and columns, not the data It's one bit (null/non-null)
for each cell, rounded to an integral number of bytes per row (i.e. 
the number of columns is rounded up to the nearest multiple of 8).

> I observed that some files like \fcell\MyMap
> are actually ~2.8GB,

The cell/<mapname> or fcell/<mapname> files are compressed, so their
size will vary depending upon the actual data. A "dummy" map which
only contains a single value will compress particularly well
(particularly integer maps, which use run-length encoding by default).

> but when I see the
> map the south part is "empty" and
> r.what return an error message: r.what: -f  - can't read
> 
> May be the 2G limit issue

Yes.

Writing a file >2GiB on Windows will probably silently create a
corrupt file. All of the data will be written, but the offsets to the
start of each row will be truncated to 32 bits. When trying to read
the file, once it passes the 2GiB limit the offsets will be negative
and seeking will fail.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-user mailing list