[GRASS-dev] [GRASS GIS] #2986: r.mapcalc with same variable on LHS and RHS

GRASS GIS trac at osgeo.org
Wed Oct 26 07:37:14 PDT 2016

#2986: r.mapcalc with same variable on LHS and RHS
  Reporter:  mankoff      |      Owner:  grass-dev@…
      Type:  defect       |     Status:  closed
  Priority:  major        |  Milestone:  7.0.4
 Component:  Docs         |    Version:  7.0.3
Resolution:  fixed        |   Keywords:  r.mapcalc
       CPU:  Unspecified  |   Platform:  Unspecified

Comment (by glynn):

 Replying to [comment:15 wenzeslaus]:

 > Is it module dependent?

 Yes. It relies upon the module having read anything relevant from the
 input map before it writes the corresponding data for the output map.

 The cell, fcell and null files are written using tempfile-and-rename, i.e.
 write the data to a temporary file, rename it into place within
 Rast_close(). Support files are written directly, so it's necessary to
 order reads and writes correctly (and take into account the fact that
 Rast_close() writes or removes some support files).

 For GDAL-linked maps (r.external, r.external.out), the behaviour is up to
 GDAL, but I wouldn't expect in-place modification to work.

 > What about `G_check_input_output_name()`?

 Currently, only 5 modules appear to use it: i.pca, r.carve, r.relief,
 r.slope.aspect, r.param.scale. If a module has multiple inputs and
 multiple outputs, the number of possible combinations which need to be
 checked could be large.

Ticket URL: <https://trac.osgeo.org/grass/ticket/2986#comment:16>
GRASS GIS <https://grass.osgeo.org>

More information about the grass-dev mailing list