[GRASS-dev] Re: [GRASS GIS] #1051: wxgui: SEARCH_PATH corruption

GRASS GIS trac at osgeo.org
Sun May 16 14:09:04 EDT 2010

#1051: wxgui: SEARCH_PATH corruption
  Reporter:  msieczka  |       Owner:  grass-dev at lists.osgeo.org
      Type:  defect    |      Status:  new                      
  Priority:  critical  |   Milestone:  6.4.0                    
 Component:  wxGUI     |     Version:  svn-releasebranch64      
Resolution:            |    Keywords:                           
  Platform:  All       |         Cpu:  All                      
Comment (by msieczka):

 Replying to [comment:2 glynn]:
 > Replying to [ticket:1051 msieczka]:

 >> If maps of the same names exist in mapset1 and mapset2, GRASS will pick
 the one from mapset1
 >> although the current mapset is mapset2. This might lead to various

 > This isn't necessarily a problem. GRASS itself doesn't care whether the
 current mapset is
 > first in the search path, or even if it's in the search path at all.

 According to my tests, the SEARCH_PATH file, if present, overrides the
 default "current mapset 1st, PERMANENT 2nd, other mapsets next" behaviour,
 up to even excluding any mapset from the search path. Mapsets' order in
 the SEARCH_PATH file determines the search order too. Do the steps 1-3 in
 #comment:description. Now:

 4. Create a vector map: v.random out=point n=1.

 5. Start a new session in mapset1.

 6. Create a vector map of the same name as in mapset2, i.e. do "v.random
 out=point n=1".

 6. Back in mapset2 troubles begin:

 a) v.info picks the map from mapset1 although we are in mapset2:

 $ v.info -h point
 WARNING: 'vector/point' was found in more mapsets (also found in
 WARNING: Using <point at mapset1>
 WARNING: 'vector/point' was found in more mapsets (also found in
 WARNING: Using <point at mapset1>
 COMMAND: v.random output="point" n=1 zmin=0.0 zmax=0.0
 GISDBASE: /home/grassdata
 LOCATION: test_location MAPSET: mapset1 USER: pok DATE: Sun May 16
 11:15:28 2010

 b) same does g.region:

 $ g.region vect=point
 WARNING: 'vector/point' was found in more mapsets (also found in
 WARNING: Using <point at mapset1>

 c) same does v.to.rast:

 $ v.to.rast use=cat in=point out=point_rast
 WARNING: 'vector/point' was found in more mapsets (also found in
 WARNING: Using <point at mapset1>
 Loading data...
 Reading features...
 Writing raster map...
 Converted areas: 0 of 0
 Converted points/lines: 1 of 1
 v.to.rast complete

 Any module I tried prefers the "point" vector map from the first mapset in
 the SEARCH_PATH (mapset1) rather the one in the current mapset (mapset2).
 I understand what Glynn says in his furher comments in #comment:2, fully
 second that, but getting back to the original subject: wxGUI's `Settings >
 GRASS working environment > Mapset access' needs a fix.

 I have attached a patch against SVN develbranch6, r42262. Please anybody
 let me know if it's acceptable. In general, it's purpose is to make
 'Mapset access' GUI work same as 'g.mapsets addmapset=/removemapset=',

 1. Doesn't allow the user to remove the current mapset from the

 2. The current mapset is always first in the SEARCH_PATH.

 3. Treats PERMANENT as any other mapset AFAICT. PERMANENT is the second in
 the search path only if the SEARCH_PATH file is not present.

 4. Doesn't sort mapset names in the SEARCH_PATH file. Thanks to this, the
 search order depends on g.mapsets add/remove commands sequence, thus can
 be controlled from GRASS itself.

Ticket URL: <http://trac.osgeo.org/grass/ticket/1051#comment:3>
GRASS GIS <http://grass.osgeo.org>

More information about the grass-dev mailing list