[GRASS-user] Buffering large grid maps

Glynn Clements glynn at gclements.plus.com
Mon Jul 21 21:28:32 EDT 2008


Milton Cezar Ribeiro wrote:

> I just started to use GRASS, and I am working with a (almost to me) very
> large dataset into GRASS 6.3.0 NATIVE WINDOWS
> I imported an Erdas image file using Gdal. Apparently I looks fine, because
> GRASS understood and create a Mapset with all informations contained on my
> IMG file (like projection, number of cells, bounding box, etc.).
> 
> The raster map is 60,000x48,000 pixels.
> 
> I tryed display my raster map (it is a binary map with values 0 and 1), but
> I can see the binary map.
> How can I display my raster map on Map Display 1? I notice that "d.raster
> teste" send the output to .tmp directory (or something like).
> 
> But my biggest problem is that I need to generate a Distance Map from those
> pixels which values is 1.
> 
> I tryed "r.buffer input=test output=teste_buffer distances=50,100" (it is in
> meters)
> but GRASS return a erros message telling that can´t allocate memory

r.buffer tries to read the entire map into memory, which isn't going
to work with a map that large (it would need 2.8GB; even if you have
that amount of RAM, a 32-bit OS probably isn't going to let you have
that much in a single block).

r.grow doesn't suffer from the memory issues of r.buffer. It only
keeps in memory as many rows as are necessary given the size of the
buffer (i.e. 2*radius+1 rows).

It doesn't support multiple distance zones, so you would need to use
multiple passes and patch the results together with r.patch.

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


More information about the grass-user mailing list