[GRASS5] Re: [bug #1231] (grass) g.copy bug: cell_misc ignored

Markus Neteler neteler at itc.it
Wed Aug 14 08:29:01 EDT 2002


On Wed, Aug 14, 2002 at 02:03:15PM +0200, Glynn Clements via RT wrote:
> Request Tracker wrote:
> 
> > this bug's URL: http://intevation.de/rt/webrt?serial_num=1231
> > -------------------------------------------------------------------------
> > 
> > Hi,
> > 
> > it seems that g.copy doesn't completely cop a map.
> > At least the range file in cell_misc/ is ignored:
> > 
> > E.g. current mapset 'modis', I am copying from 'PERMANENT' into
> > 'modis':
> > 
> > GRASS:~ > l ~/grassdata/pat/PERMANENT/cell_misc/geologia/
> > total 4
> > -r--r--r--    1 merler   ssi            10 Jul 20  1998 range
> > 
> > GRASS:~ > g.copy geologia,test
> > COPY [geologia at PERMANENT] to [test]
> >  raster
> >  header
> >  category
> >  color
> >  history
> >  misc
> >  fcell    MISSING
> >  g3dcell  MISSING
> > 
> > GRASS:~ >l ~/grassdata/pat/PERMANENT/cell_misc/test
> > ls: /ssi0/ssi/neteler/grassdata/pat/PERMANENT/cell_misc/test: No such file or
> > directory
> 
> Er, shouldn't this be "modis" instead of "PERMANENT"?

Er, yes. Sorry, but....
 
> AFAICT, g.copy *does* copy the cell_misc/<map> directory (assuming
> that it's in etc/element_list).

You are right. The problem is still there, but different:


GRASS:~ > l /ssi0/ssi/neteler/grassdata/pat/neteler/cell_misc/test
total 4
-r--r--r--    1 neteler  ssi            10 Aug 14 14:25 range
^^^

GRASS:~ > r.support -r test
   Updating the stats for [test]
 WARNING: can't write range file for [test in neteler]
   Updating the number of categories for [test]

The permissions should be
-rw-r--r--

right? That's the real problem where I was struggling.

> > I feel that this should be fixed for 5.0.0 since the cell_misc
> > may also contain histogram, reclassed_to and null.
> 
> Note that g.copy explicitly removes the reclassed_to file. This is
> correct; however:
> 
> 1. The code is part of cmd/copy.c, whereas the code to remove the
> colr2 file is in lib/do_copy.c.
> 
> 2. It uses sprintf/system ("rm -f ..."), rather than G_remove().

Brrr...

Markus



More information about the grass-dev mailing list