[GRASS-dev] [GRASS GIS] #3857: r.mapcalc unable to rename null and cell files

GRASS GIS trac at osgeo.org
Fri May 31 17:18:54 PDT 2019


#3857: r.mapcalc unable to rename null and cell files
----------------------+-------------------------
  Reporter:  Hygsson  |      Owner:  grass-dev@…
      Type:  defect   |     Status:  new
  Priority:  major    |  Milestone:  7.6.2
 Component:  Raster   |    Version:  unspecified
Resolution:           |   Keywords:  r.mapcalc
       CPU:  x86-64   |   Platform:  MSWindows 7
----------------------+-------------------------

Comment (by wenzeslaus):

 Overwriting map you are reading from is not allowed according to the
 documentation:

 //A map cannot be used both as an input and as an output as in this
 invalid expression `oldmap = oldmap + 1`, instead a subsequent rename
 using `g.rename` is needed when the same name is desired: //

 {{{
 r.mapcalc "newmap = oldmap + 1"
 g.rename raster=newmap,oldmap
 }}}

 https://grass.osgeo.org/grass76/manuals/r.mapcalc.html#using-the-same-map-
 for-input-and-output-results

 It may work in some cases, but it is not guaranteed. Maybe a check of the
 inputs and outputs and an error message on Windows and a warning on other
 platforms would be backward-compatible solution. Would you mind opening a
 new ticket? On the other hand, having this feature (`a = a + 1`) seems
 reasonable (but supporting it is more complex).

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



More information about the grass-dev mailing list