[GRASS-user] r.out format

Glynn Clements glynn at gclements.plus.com
Thu Mar 8 02:21:58 EST 2007


Tyler Smith wrote:

> > This matches the output from r.out.arc; AFAICT, r.out.ascii has never
> > been able to produce that format.
> > 
> > 
> > > What do I need to do to export in the first format above, and to do so
> > > in such a way that only the current region is exported, not the whole
> > > raster map?
> > 
> > r.out.arc, probably.
> > 
> Thank you! That's it exactly. Now I feel like a bit of a bone-head for not
> having seen what was right there in the help pages all along. 
> 
> On a related note, what is the best way to store your work from one
> session to the next?

If you're using bash, there should be a .bash_history file in the
mapset directory. Typing "history" within a GRASS session will display
the history.

If desired, you can use the environment variable HISTFILESIZE to
increase the maximum length of the history file (the default is 500
lines; that value was probably chosen at a time when hard discs were
typically smaller than they are today).

> If I had been able to go back over my previous
> days work I'd have seen that I was using r.out.arc in the first
> place. I was thinking of running grass from a shell inside emacs, and
> then saving the buffer at the end of the session as a log of my
> efforts, unless anyone has a better idea?

I use XEmacs' shell-mode for everything except programs which require
curses. Some tips if you want to go that route:

1. export GRASS_PAGER=cat (no need to use "more" or "less" when you
have unlimited scrollback).

2. export GRASS_MESSAGE_FORMAT=silent

This only works in the most recent CVS version. It disables the
percentage output, which would otherwise dumps lots of:

	0%^H^H^H^H^H   3%^H^H^H^H^H ...

into the buffer.

3. Pass the grass63 script the full path to the mapset directory, to
skip the curses-based startup window.

Alternatively, you can avoid using the grass63 script altogether. My
~/.bashrc sources ~/.bashrc.grass, which contains:

	export GISBASE=/opt/grass-6.3.cvs
	export GRASS_GNUPLOT='gnuplot -persist'
	export GRASS_WIDTH=640
	export GRASS_HEIGHT=480
	export GRASS_HTML_BROWSER=firefox
	export GRASS_PAGER=cat
	export GRASS_PERL=perl
	export GRASS_TCLSH=tclsh
	export GRASS_WISH=wish
	
	export PATH="$GISBASE/bin:$GISBASE/scripts:$PATH"
	export LD_LIBRARY_PATH="$GISBASE/lib"
	export GRASS_LD_LIBRARY_PATH="$LD_LIBRARY_PATH"
	
	export GIS_LOCK=$$
	export GRASS_VERSION="6.1.cvs"
	
	tmp=/tmp/grass6-"`whoami`"-$GIS_LOCK
	export GISRC="$tmp/gisrc"
	mkdir "$tmp"
	cp ~/.grassrc6 "$GISRC"

This allows you to use GRASS commands in any shell; if your X startup
sources ~/.bashrc, then you can run them directly from X programs,
e.g. using M-! in XEmacs.

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




More information about the grass-user mailing list