Opened 5 years ago

#3858 new enhancement

r.mapcalc - Add warning when the same map is used both as an input and an output

Reported by: Hygsson Owned by: grass-dev@…
Priority: normal Milestone: 7.6.2
Component: Raster Version: unspecified
Keywords: r.mapcalc Cc:
CPU: x86-64 Platform: MSWindows 7

Description

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

While (oldmap = oldmap + 1) may work on Linux, it will result in error on Windows.

As Wenzeslaus suggested in ticket:3857#comment:1, the solution might be to check inputs and outputs beforehand and add a warning for Linux and an error message for MS Windows.

Change History (0)

Note: See TracTickets for help on using tickets.