[GRASS5] maps with identical name in different mapsets

Markus Neteler neteler at itc.it
Wed Mar 13 06:09:57 EST 2002


On Wed, Mar 13, 2002 at 10:59:41AM +0000, Glynn Clements wrote:
> 
> Markus Neteler wrote:
> 
> > today we discovered that it is possible to generate a map (raster
> > map) with r.proj under a certain name even if this name is already
> > in use in another mapset. There is no test telling that the
> > map name is used.
> > 
> > I see a potential problem here: Which map is taken when displaying
> > it or doing calculations? First in the current mapset, then from
> > another (and which order, alphabetically?).
> 
> The default behaviour is the current mapset followed by PERMANENT.
> 
> And you should only get the default behaviour unless you explicitly
> change it with g.mapsets (in which case, you are presumably aware of
> the concept of a mapset search path).

yes, I am using that concept daily.
 
> > Eventually we should add a test to a GRASS library function to
> > check for existing names in current mapset search path to avoid
> > this problem. It is at least implemented in g.copy:
> > src/general/manage/cmd/copy.c
> 
> Personally, I don't see it as a problem. In the same way that I don't
> see any problem with lots of directories all containing files called
> "README" or "Makefile".

This is a bit different. In your example you are actively changing into
a directory. So one knows what he/she is doing.
With a mapset search path GRASS is searching the mapsets which is
not printed every time.

> Actually, I think that it's preferable to define the set of allowable
> map names in absolute terms, without any kind of "... unless it
> already exists in some other mapset" exclusion.
> 
> Also, if a map names were meant to be unique within a location (rather
> than just within a single mapset), what's the point of the
> "map at mapset" syntax?

That's right.
 
> > Maybe I am missing something, but we cannot be sure which map
> > is picked up when a map name exists several times (at least it
> > is not obvious to the user).
> 
> Well, it should also be explained right at the very beginning of any
> user guide or tutorial. And if a user can't grasp this concept, I'm
> not sure that they are going be able to grasp the other concepts
> involved.

Mhhh. Ok - an example.

We have these mapsets activated with g.mapsets:

neteler PERMANENT dtm belluno

There may be a file 'dtm10' both in 'dtm' and 'belluno'. The user
may have already forgotten that it exists twice. When using d.rast,
is the mapset search path searched 1. own, 2. PERMANENT, 3. alphabetically?
If yes, will the user remember that the map exists twice (I am sure that
he/she won't remember). 
Addition: In our project location here we have around 5000 maps
in 76 mapsets, 8 people are adding maps daily. Like that I would have to
always run g.list to verify that I pick the right map, perhaps a
colleage had added a map with same name yesterday in a mapset which is
in my current mapset search path ....

So this problem exists mostly for work-groups.

Hope I could illustrate the problem a bit better now.

 Markus




More information about the grass-dev mailing list