[GRASS5] maps with identical name in different mapsets

Glynn Clements glynn.clements at virgin.net
Wed Mar 13 05:59:41 EST 2002


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).

> 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".

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?

> 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.

-- 
Glynn Clements <glynn.clements at virgin.net>



More information about the grass-dev mailing list