Platform: GNU/Linux/x86
grass obtained from: CVS
grass binary for platform: Compiled from Sources
GRASS Version: 2006-09-23
$ v.patch -e -a input=map1 output=map2
Error: option <output>: <map2> exists.
Should v.patch in -a(ppend) mode automatically set the --ovewrite flag?
It kind-off works:
$ v.patch -e -a input=map1 output=map2 --o
But leaves the output vector in a somewhat strange state - it is OK for Grass commands (v.digit, v.info -c) but QGIS (current SVN head) complains about it that "No layers available in this map". After I v.build this vector, QGIS accepts it.
v.build helps, but it shouldn't be required. v.patch should output a valid vector. Or maybe this is QGIS fault?
What do you think Radim?
Maciek
-------------------------------------------- Managed by Request Tracker
R.mask is a shell script, so the -o flag is there to run the underlying
GRASS module with --o.
Is there a better way to do this script programmers?
Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University
The reason I ask is that --o, by design, doesn't show up in the
module/script GUI. For r.mask, much of the time, the user will simply want
to overwrite the existing MASK file, to avoid the annoyance of having to run
g.remove each time (note the MASK file created by r.mask is a reclass of a
real raster file, so there is little loss if it is deleted).
So in this case, I'd prefer to have an overwrite option easily accessible to
a user. How best to do this?
Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University
On Mon, Sep 25, 2006 at 08:13:38AM -0700, Michael Barton wrote:
Is having both -o and --o a problem?
The reason I ask is that --o, by design, doesn't show up in the
module/script GUI.
This is a problem which should be fixed in parser.c for
both XML and tcltk. I was already asked by several users
why --overwrite doesn't show up but forgot to report it
here.
For r.mask, much of the time, the user will simply want
to overwrite the existing MASK file, to avoid the annoyance of having to run
g.remove each time (note the MASK file created by r.mask is a reclass of a
real raster file, so there is little loss if it is deleted).
So in this case, I'd prefer to have an overwrite option easily accessible to
a user. How best to do this?
The --overwrite stuff already implemented for HTML/generic needs to
be added into the XML and TclTk sections in
lib/gis/parser.c
Markus
Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University
> From: Maciej Sieczka <tutey@o2.pl>
> Date: Mon, 25 Sep 2006 11:53:57 +0200
> To: Michael Barton <michael.barton@asu.edu>
> Cc: <grass-dev@grass.itc.it>
> Subject: Re: [GRASS-dev] interferring ovewrite flags [was: [bug #5167] (grass)
> v.patch: -a(ppend) issues]
>
> Michael Barton wrote:
>> R.mask is a shell script, so the -o flag is there to run the underlying
>> GRASS module with --o.
>>
>> Is there a better way to do this script programmers?
>
> r.reclass (used in r.mask) supports --o as all other Grass raster
> modules do (besides r.mapcalc).
>
> I checked r.mask and it doesn't matter whether you use it with -o or
> --o. In both cases the output is ovewritten, so you just remove your -o.
>
> Looks like parser takes care of it.
>
> Maciek
--
Markus Neteler <neteler itc it> http://mpa.itc.it/markus/
ITC-irst - Centro per la Ricerca Scientifica e Tecnologica
MPBA - Predictive Models for Biol. & Environ. Data Analysis
Via Sommarive, 18 - 38050 Povo (Trento), Italy
> Is having both -o and --o a problem?
>
> The reason I ask is that --o, by design, doesn't show up in the
> module/script GUI.
This is a problem which should be fixed in parser.c for
both XML and tcltk. I was already asked by several users
why --overwrite doesn't show up but forgot to report it
here.
> For r.mask, much of the time, the user will simply want
> to overwrite the existing MASK file, to avoid the annoyance of having to run
> g.remove each time (note the MASK file created by r.mask is a reclass of a
> real raster file, so there is little loss if it is deleted).
>
> So in this case, I'd prefer to have an overwrite option easily accessible to
> a user. How best to do this?
The --overwrite stuff already implemented for HTML/generic needs to
be added into the XML and TclTk sections in
lib/gis/parser.c
It shouldn't be added to the Tcl/Tk section; as the switch is always
available in every module, it should be left to the UI to add it.
Note that it can't simply be added as if it were a normal flag due to
the double dash. Apart from that, it shouldn't be added as if it were
a normal flag due to the fact that it doesn't behave like other flags,
e.g. it cannot be composed.
There doesn't seem to be much point in adding another item type
(alongside flag and option) for the hardcoded flags.
The reason I ask is that --o, by design, doesn't show up in the
module/script GUI. For r.mask, much of the time, the user will simply
want to overwrite the existing MASK file, to avoid the annoyance of
having to run g.remove each time (note the MASK file created by r.mask
is a reclass of a real raster file, so there is little loss if it is
deleted).
So in this case, I'd prefer to have an overwrite option easily
accessible to a user. How best to do this?
be careful with using r.mask or r.mapcalc to overwrite a MASK. If the
old mask is still present when the new one is created, it will be an
additive replacement, not a full replacement. This can be very useful
for "building up" a MASK map, but also cause lots of problems if you
aren't expecting it.
I'm not exactly sure how r.reclass works (thus r.mask script too), but
it will work like this if it reads raster data row by row.
I don't *think* that r.reclass will work additively because it just makes a
new copy of the tables in cellhd and cats for the same map. I've never
noticed it when making masks.
But I haven't tested it for this specific "feature".
How can you make a mask additive with r.mapcalc? This could be useful
sometime.
Michael
__________________________________________
Michael Barton, Professor of Anthropology
School of Human Evolution & Social Change
Center for Social Dynamics & Complexity
Arizona State University
From: Hamish <hamish_nospam@yahoo.com>
Date: Mon, 2 Oct 2006 15:08:49 +1300
To: Michael Barton <michael.barton@asu.edu>
Cc: <tutey@o2.pl>, <grass-dev@grass.itc.it>
Subject: Re: [GRASS-dev] interferring ovewrite flags [was: [bug #5167] (grass)
v.patch: -a(ppend) issues]
Michael Barton wrote:
Is having both -o and --o a problem?
The reason I ask is that --o, by design, doesn't show up in the
module/script GUI. For r.mask, much of the time, the user will simply
want to overwrite the existing MASK file, to avoid the annoyance of
having to run g.remove each time (note the MASK file created by r.mask
is a reclass of a real raster file, so there is little loss if it is
deleted).
So in this case, I'd prefer to have an overwrite option easily
accessible to a user. How best to do this?
be careful with using r.mask or r.mapcalc to overwrite a MASK. If the
old mask is still present when the new one is created, it will be an
additive replacement, not a full replacement. This can be very useful
for "building up" a MASK map, but also cause lots of problems if you
aren't expecting it.
I'm not exactly sure how r.reclass works (thus r.mask script too), but
it will work like this if it reads raster data row by row.