[GRASS-dev] [GRASS GIS] #1691: r.ros and r.spread don't overwrite

#1691: r.ros and r.spread don't overwrite
----------------------------+-----------------------------------------------
Reporter: madi | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Raster | Version: svn-releasebranch64
Keywords: r.ros,r.spread | Platform: Linux
      Cpu: x86-64 |
----------------------------+-----------------------------------------------
Using r.ros and r.spread in a python script I realized that the option
"overwrite" doesn't have any effect.. I'm on Linux, grass6.4.3svn.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/1691&gt;
GRASS GIS <http://grass.osgeo.org>

#1691: r.ros and r.spread don't overwrite
-----------------------------+----------------------------------------------
Reporter: madi | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 6.4.3
Component: Raster | Version: svn-releasebranch64
Keywords: r.ros, r.spread | Platform: Linux
      Cpu: x86-64 |
-----------------------------+----------------------------------------------
Changes (by hamish):

  * keywords: r.ros,r.spread => r.ros, r.spread

Comment:

perhaps for r.ros because output= is just a prefix for a number of output
maps? maybe it needs to setenv() the overwrite flag in that case to work-
around? (just an idea)

see also g.copy, g.rename --overwrite ticket #1658 for some info on how it
works.

Hamish

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1691#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#1691: r.ros and r.spread don't overwrite
-----------------------------+----------------------------------------------
Reporter: madi | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Raster | Version: svn-releasebranch64
Keywords: r.ros, r.spread | Platform: Linux
      Cpu: x86-64 |
-----------------------------+----------------------------------------------
Changes (by wenzeslaus):

  * milestone: 6.4.3 => 7.0.0

Comment:

Replying to [comment:1 hamish]:

> perhaps for r.ros because output= is just a prefix for a number of
output maps?

See #2136 for the prefix/basename discussion and fix of overwrite for
G7:i.pca and G7:r.texture (r58311).

However, from the quick test, this seems to work in the current trunk
(r59190):

{{{
$ r.ros model=aaa moisture_1h=bbb moisture_live=ccc output=ddd
r.ros complete. Raster maps <ddd.base>, <ddd.max> and <ddd.maxdir>
created.

$ r.ros model=aaa moisture_1h=bbb moisture_live=ccc output=ddd
ERROR: Raster map <ddd.base> already exists in mapset <PERMANENT>

$ r.ros --overwrite model=aaa moisture_1h=bbb moisture_live=ccc output=ddd
r.ros complete. Raster maps <ddd.base>, <ddd.max> and <ddd.maxdir>
created.
}}}

The problem now is that when I already have map named as the
prefix/basename, it will not let me proceed:

{{{
$ r.mapcalc "eee = 1"
$ r.ros --overwrite model=aaa moisture_1h=bbb moisture_live=ccc output=eee
ERROR: option <output>: <eee> exists.
}}}

This may be good for safety but then the error message (or the situation)
is confusing because when I do overwrite, it will not overwrite that
`eee`, it will create new ones (`eee.*`) and I will still have the old
`eee`.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/1691#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>