[GRASS-dev] Re: [GRASS GIS] #70: imagery modules: strip @mapset part

GRASS GIS trac at osgeo.org
Sat Jun 21 08:41:07 EDT 2008


#70: imagery modules: strip @mapset part
----------------------+-----------------------------------------------------
  Reporter:  hamish   |       Owner:  grass-dev at lists.osgeo.org
      Type:  defect   |      Status:  new                      
  Priority:  major    |   Milestone:  6.4.0                    
 Component:  default  |     Version:  svn-trunk                
Resolution:           |    Keywords:  imagery                  
----------------------+-----------------------------------------------------
Comment (by neteler):

 Replying to [comment:20 glynn]:
 > Replying to [comment:17 neteler]:
 >
 > > It compares the wrong mapsets here (G_mapset() should possibly not
 > > used on the left side, see function remove_subgroup_files() of main.c
 of i.group.
 >
 > AFAICT, you should be able to use in=lsat7_2000_61 at landsat to acheive
 the desired result.

 this is working but not practical. I could have generated the group some
 years ago, for a normal user it's hard to find out this trick (yes, use -l
 and such but...).

 Maybe: if a map appears only once in the list, remove it. Otherwise tell
 the user to indicate the mapset.

 > Beyond that: unless "landsat" is in the mapset search path, this isn't a
 bug; you '''should''' have to explicitly specify the @landsat part.

 It's not obvious (see above).

 > OTOH, in the case where it '''is''' in the mapset search path, it's a
 limitation of the imagery library. The I_find_* functions only ever look
 for files in the current mapset (passing a qualified name to I_find_* will
 generate an error if the @mapset part doesn't specify the current mapset).

 AFAIK the imagery library was written in the early days of GRASS,
 apparently improvements from libgis were never integrated.

 > I didn't change this when I fixed the I_find_* functions because I can't
 easily determine if it will introduce potentially dangerous bugs (e.g.
 deleting the wrong file).

 Note that here we just remove a *reference* to a file (though I don't know
 about side effects of the used functions).

 > Unlike the G_find_* functions, the I_find_* functions don't have a
 mapset argument, so the caller doesn't get the option of passing
 G_mapset() instead of "" to prevent the use of other mapsets. Bear in mind
 that the same functions are used for both input (where other mapsets may
 be used) and output (where only the current mapset may be used).

 Could the G_find_* functions be used instead?

 Markus

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


More information about the grass-dev mailing list