[GRASSLIST:172] Re: Reading/writing maps

Soil & Water Lab. swlab at cornell.edu
Sat May 24 21:07:55 EDT 2003


> > And now, reverse question : is it possible to create a raster from stdin
> > ? I was having in mind to send the output of "r.stats -1", play with it,
> > and send it back to...to...to this mysterious command that may not even
> > exist, without having to write any file on the hard disk. Of course, you
> > have guessed that I do not speak C.
>
> r.in.ascii and r.in.{pbm,pgm,ppm} all accept text (non-binary) input.

OK, a r.in.ascii commands would work, provided that I don't forget to put the 
proper header before the processed stream (and I guess I can grab the header 
from lines 3-8 of an adequate WIND file fairly easily). I wonder if it's 
worth, eventually, computer-time-wise, to process/compute maps with a script 
instead of a C prog... For fairly simple calculations, "r.mapcalc" gives 
results fast enough. For more complex computations, that can be an issue, 
though, I'm afraid I'll have to learn C. Or at least Perl
Still, thanks for the r.in.ascii trick.
P.
PS: the link to the HTML version of the GRASS5.0 Programmer manual is broken.




More information about the grass-user mailing list