[GRASS5] Identify GRASS database directory

Justin Hickey jhickey at hpcc.nectec.or.th
Thu Feb 8 23:33:30 EST 2001


Hi Bernhard

"B. Byars" wrote:
> 
> > If you already have some script, it would be great if you are
> > willing to share it.  Mail it to me or make it overwise available.
> 
> Hi Bernhard,
> 
> I'll email you my scripts in just a bit.  Do look at Justin's
> scripts in tcltk as Markus suggests as well.

What I do in the startup script is check if PERMANENT is a mapset of the
given location. As Bruce stated, there is no real guarantee that
PERMANENT will be a mapset in all locations, but I have also seen
mapsets without a WIND file as well. In short, to the best of my
knowledge, there is no way to guarantee a particular directory belongs
to Grass. The reason I picked the check for PERMANENT was because some
Grass modules will report an error if a location does not contain a
PERMANENT mapset. At least I remember getting that error a few times in
the past.

However, I plan to change this in the new initialization code I am
working on. I not only plan to add a check for a PERMANENT mapset in the
current location when you start Grass, I also plan to put in a Create
Location feature that will always create a PERMANENT mapset as part of
the creation process. Thus, checking for a PERMANENT mapset will be a
reliable way to test for Grass databases starting with Grass 5.1 (I
hope).

If you're interested in looking at the code it is in
src/tcltkgrass/main/gis_set.tcl in the procedure CheckLocation around
line 220.

Hope this helps.

-- 
Sincerely,

Jazzman (a.k.a. Justin Hickey)  e-mail: jhickey at hpcc.nectec.or.th
High Performance Computing Center
National Electronics and Computer Technology Center (NECTEC)
Bangkok, Thailand
==================================================================
People who think they know everything are very irritating to those
of us who do.  ---Anonymous

Jazz and Trek Rule!!!
==================================================================

---------------------------------------- 
If you want to unsubscribe from GRASS Development Team mailing list write to:
minordomo at geog.uni-hannover.de with
subject 'unsubscribe grass5'



More information about the grass-dev mailing list