[GRASS5] [bug #1797] (grass) g.gisenv

Glynn Clements glynn.clements at virgin.net
Thu Apr 17 18:56:37 EDT 2003

Harmisch Bowman via RT wrote:

> With respect to being able to set a new mapset after the old has been set
> incorrectly with g.gisenv, this seems to work fine, thanks. Can you forsee any
> unwanted repercussions?

No. The only code which is actually bypassed by that change is the
check for a valid database/location/mapset. I've looked through the
various parts of libgis which could be called (basically parser.c and
env.c), and I can't see any way in which this could matter.

> I'm still looking for a (gis lib) way of testing to see if a mapset/whatever
> exists without the library function generating a fatal error. ?
> (for test before G_setenv)

G__mapset_permissions() should do the job. The database and location
parameters need to be set; the mapset is passed as a parameter.

I wouldn't recommend adding special-case checks to g.gisenv. However,
it would be useful to have a better way to change the GISDBASE,
LOCATION_NAME and MAPSET parameters. Either a dedicated utility, or a
re-write of the set_data program.

BTW, a few things still don't like database/location/mapset switching;
primarily tcltkgrass (this needs to call g.gisenv for each operation,
rather than just at the start of the program) and XDRIVER's resize
handling (which should just be removed).

Glynn Clements <glynn.clements at virgin.net>

More information about the grass-dev mailing list