[GRASS-dev] TclTk animator finished - replaces xganim

Glynn Clements glynn at gclements.plus.com
Fri Sep 14 22:19:08 EDT 2007


Michael Barton wrote:

> >> Main window- when I hit exit I get this error over and over and have to
> >> use xkill to get rid of it (taking down gis.m too):
> >> 
> >> ERROR: <nsres=0> ** invalid input **
> >> ERROR: <nsres=0> ** invalid input **
> >>     while executing
> >> "exec g.region nsres=$oldres1 ewres=$oldres2"
> >>     (procedure "GmAnim::cmd_exit" line 19)
> >>     invoked from within
> >> "GmAnim::cmd_exit"
> >>     (command bound to event)
> > 
> > It should be using $WIND_OVERRIDE or $GRASS_REGION, *not* modifying
> > the WIND file.
> 
> Yes, you're probably right even though this involves computational regions
> rather than display regions. I've already thought of this, but wanted to get
> the whole concept working before I tackled the tricky problem of trying to
> code one of these approaches (tricky because of different formats between
> latlon and non-latlon regions).
> 
> Do you have a recommendation for which would be better in this case? I
> assume that in either case, I'll have to replicate the entire region
> information even though I only need to temporarily change the resolution
> while r.out.ppm is running.

$WIND_OVERRIDE is easier, because you can still use g.region to set
the resolution.

	g.region save=$tmpregion
	set env(WIND_OVERRIDE) $tmpregion
	g.region nsres=... ewres=...
	# r.out.ppm commands go here
	unset env(WIND_OVERRIDE)
	g.remove region=$tmpregion

$GRASS_REGION is more robust, as you don't have to create a unique
name for the temporary region, and there's no risk of the temporary
region being left behind if the program terminates prematurely.

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




More information about the grass-dev mailing list