[GRASS-dev] [GRASS GIS] #1886: Error in input may result in r.proj overwriting exising layers

GRASS GIS trac at osgeo.org
Thu Feb 14 06:40:36 PST 2013


#1886: Error in input may result in r.proj overwriting exising layers
------------------------+---------------------------------------------------
 Reporter:  pvanbosgeo  |       Owner:  grass-dev@…              
     Type:  defect      |      Status:  new                      
 Priority:  normal      |   Milestone:  7.0.0                    
Component:  Raster      |     Version:  svn-trunk                
 Keywords:              |    Platform:  Unspecified              
      Cpu:  x86-64      |  
------------------------+---------------------------------------------------
 Suppose I want to project the layer bio_2 to the current mapset from the
 location/mapset latlon/climate. I would use:

 {{{
 r.proj input=bio_2 location=latlon mapset=climate
 dbase=/home/paulo/Data/GRASSdb
 }}}


 The following (erroneous?) statement also works:

 {{{
 r.proj input=bio_2 at climate location=latlon mapset=climate
 dbase=/home/paulo/Data/GRASSdb
 }}}


 There is one important difference. If the layer bio_2 already exist in the
 current mapset, the first statement will give an error message stating
 that the layer already exists. Using the second statement, the existing
 layer is overwritten without any further warning.

 Yes, the user is suppose to only give the name of the layer (without the
 mapset name). But if somebody does make such a mistake (I evidently did),
 layers might get overwritten unintentionally.

 It seems the function takes the whole name, including the '@mapset' when
 checking if a layer already exists, but then continues to only use the
 part before '@mapset' when creating the layer.

 A more consistent behavior, i.m.h.o., would be if in both steps, the
 '@mapset' is ignored (which would eliminate the possibility of unwittingly
 overwriting layers). Alternatively, it should be impossible to use an
 input name which includes a '@mapset' part (doing so should give an error
 message).

-- 
Ticket URL: <http://trac.osgeo.org/grass/ticket/1886>
GRASS GIS <http://grass.osgeo.org>



More information about the grass-dev mailing list