[GRASS-user] G_calloc error using r.in.xyz

Hamish hamish_b at yahoo.com
Tue Feb 7 17:14:33 EST 2012

Patrick wrote:
> r.in.xyz in=FILENAME.txt fs=, out=FILENAME_RAST
> I receive the error
> ERROR:  G_calloc: unable to allocate 1253898072 * 4 bytes at
> main.c:431

it means you are out of memory. (fwiw the development branches
include the missing word but it has not been backported to 6.4

check 'g.region -p', probably the rows,columns are way too huge.
try to keep them smaller than 45000x45000 for starters. (bigger
is allowed if you have enough computer)

fix with 'g.region res=100 -a' or whatever resolution you need.
see the r.in.xyz help page.

usually it is a multi-step process:
run r.in.xyz with -g to find the data extent,
use that with g.region, and pick a resolution to use (and -a)
'g.region -p' and make sure the rows,columns are not too crazy
rin r.in.xyz with method=n, then r.null to remove zeros, then
r.univar to see average/median lidar points per cell,
re-adjust g.region resolution depending on you statistical power
needs and re-run r.in.xyz to check the new res. (or more quick
and dirty view the resulting map and adjust & rerun until the
tiny holes start to go away)
run r.buffer to make a coverage map for later use with r.mask.
run v.surf.bspline (or similar) to fill the rest of the holes
in the data. (then apply mask from last step to keep it constrained)

not all those steps are always needed, but that's my typical


More information about the grass-user mailing list