[GRASS-dev] Re: [GRASS-user] problems using r.proj with large
glynn at gclements.plus.com
Thu Feb 8 15:15:01 EST 2007
William Kyngesburye wrote:
> > r.proj.seg (and r.proj) both work by switching environments between
> > the input and output locations. It appears to be creating the
> > temporary file while the input location is active, when it should be
> > using the output location (you may not have write permission for the
> > input location).
> That's the odd part - it's really a combination of the input
> *location* and the output (current) *mapset* name.
Ah. Now *that* is a bug in either G_tempfile() or G_mapset(),
depending upon your perspective.
G_mapset() does one-shot initialisation, i.e. it takes a copy of the
value of the MAPSET variable the first time that it's called, and
returns the copied value thereafter. G__mapset() returns the value
Note that G_location() behaves like G__mapset() rather than like
G_mapset() (i.e. it returns the value of the LOCATION_NAME variable
directly). There isn't a location equivalent of G_mapset().
All in all, this is likely to lead to, er, "counter-intuitive"
behaviour in conjunction G__switch_env(). Needless to say, none of
this appears to be documented anywhere. Actually, I doubt that anyone
was even aware of this until now; I didn't notice this specific issue
in your first message, only that the directory was "wrong".
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev