[GRASS-user] vector to raster: ERROR: G_calloc: unable

Hamish hamish_b at yahoo.com
Tue Apr 21 11:46:30 EDT 2009


Martin Wegmann  wrote:
> I solved it by using a different GIS and just copying the
> column to a new one with the type:INTEGER, however I would
> like to know how to do it with GRASS for the next time.

Hamish:
> > what does 'g.region -p' say? are the rows x columns
> > some huge number?
> > (ie bigger than 15000x15000 or so?)
> 
> rows:       96256
> cols:       128204
> cells:      12340404224

that is the problem, you have asked for the raster to be
too huge. do you really need that fine a resolution? e.g. it
is not meaningful to measure the edge of a forest to the nearest
mm.


> > how much memory does you system have?
> 
> 4GB Memory
> Debian unstable if relevant

as MarkusM pointed out, reduce the number of rows in memory at
one time and it should work.

if you have it set to use 4096 rows in memory for each pass,
that's:

4096 * 128204 cells/row * 8 bytes/cell = 4200988672 bytes
of memory needed per pass = 4102mb = 4.1gb RAM + overhead.


> Does it mean that DOUBLE PRECISION with the 4GB memory does
> not work? How can I change the column then to INTEGER inside
> GRASS?

it works if you have the resources or ask for a smaller task.


> BTW, when I did it with the new vector file:
> 
> same v.info -t output - just one additional column, the
> v.to.rast excecuted without any problems and the raster
> looks fine, but if returned this output:
> 
> v.to.rast input=in_new output=out column=LS_LEGEN_1 type=area
> ....
> Pass 24 of 24:
> Reading areas...
>  100%
> Writing raster map...
>  100%
> 
> Cannot allocate memory: can't create fork
> 
> what does it mean, not enough memory?

Yes, but I'm not sure why it's trying to fork the process while
closing the map. Not sure if that happened while it was writing
the map's meta data or upon module tear-down.


Hamish



      



More information about the grass-user mailing list