[GRASS-dev] Re: [GRASS GIS] #326: g.findfile element=colr2

GRASS GIS trac at osgeo.org
Thu Oct 9 06:27:53 EDT 2008


#326: g.findfile element=colr2
--------------------------+-------------------------------------------------
  Reporter:  martinl      |       Owner:  grass-dev at lists.osgeo.org
      Type:  enhancement  |      Status:  new                      
  Priority:  major        |   Milestone:  6.4.0                    
 Component:  default      |     Version:  svn-develbranch6         
Resolution:               |    Keywords:  colr2, color table       
  Platform:  All          |         Cpu:  All                      
--------------------------+-------------------------------------------------
Changes (by glynn):

  * type:  defect => enhancement

Comment:

 Replying to [ticket:326 martinl]:

 > Module g.findfile doesn't support 'colr2' element. The attached patch
 adds this support. 'colr2' element can be searched only in the current
 mapset and file needs to be given as fully qualified, e.g.

 The suggested fix is bogus. G!__file_name() does not need and should not
 have a hard-coded hack for the colr2 directory.

 The correct way to handle colr2 is to first determine the mapset of the
 map in question, then specify the "element" parameter as "colr2/<mapset>".
 This correctly handles the case where the mapset search path isn't just
 the current mapset plus PERMANENT, i.e. it will find a colr2 file for the
 map in any mapset in the search path, not just the current mapset.

 While an extension to g.findfile might be useful, it isn't strictly
 necessary. You can perform the lookup described above using g.findfile:

 {{{
 $ eval `g.findfile element=cell file=elevation.dem`
 $ eval `g.findfile element=colr2/$mapset file=elevation.dem`
 $ echo "$file"
 /opt/grass-data/spearfish57/glynn/colr2/PERMANENT/elevation.dem
 }}}

 What would be useful is a misc= option to allow the use of
 G_find_file2_misc(), so that you can find cell_misc elements, subgroup
 elements, etc.

 BTW, why would you be using g.findfile to locate colour tables in the
 first place?
 You shouldn't normally need to know whether a map gets its colour table
 from colr, colr2, or uses the default rainbow table.

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/326#comment:1>
GRASS GIS <http://grass.osgeo.org>


More information about the grass-dev mailing list