Sat, Apr 29 2006
18:27:36
|
|
Request created by guest
|
|
Subject: r.blend: overwrites the output instead of 'Error: map exists.'
Platform: GNU/Linux/x86
grass obtained from: CVS
grass binary for platform: Compiled from Sources
GRASS Version: 2006-04-23
As the title reads. Also, r.blend GUI misses the neat green progress bar.
Maciek
|
|
Sat, Apr 29 2006
19:01:04
|
|
Mail sent by neteler@itc.it
|
|
Return-Path |
<neteler@itc.it>
|
Delivered-To |
grass-bugs@lists.intevation.de
|
Date |
Sat, 29 Apr 2006 19:00:56 +0200
|
From |
Markus Neteler <neteler@itc.it>
|
To |
Request Tracker <grass-bugs@intevation.de>
|
Cc |
grass5@grass.itc.it
|
Subject |
Re: [GRASS5] [bug #4368] (grass) r.blend: overwrites the output instead of 'Error: map exists.'
|
Message-ID |
<20060429170056.GE14270@bartok.itc.it>
|
Mail-Followup-To |
Request Tracker <grass-bugs@intevation.de>, grass5@grass.itc.it
|
References |
<20060429162736.21060101EEC@lists.intevation.de>
|
Mime-Version |
1.0
|
Content-Type |
text/plain; charset=us-ascii
|
Content-Disposition |
inline
|
In-Reply-To |
<20060429162736.21060101EEC@lists.intevation.de>
|
X-PGP-Key |
http://www.gdf-hannover.de/neteler/markus_gpgkey.asc
|
X-PGP-Fingerprint |
D4D5 2F80 120E AD60 E2F6 2297 21B3 D02B E1E7 E789
|
User-Agent |
Mutt/1.5.11
|
X-Spam-Status |
No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
|
X-Spam-Level |
|
On Sat, Apr 29, 2006 at 06:27:36PM +0200, Request Tracker wrote:
> this bug's URL: http://intevation.de/rt/webrt?serial_num=4368
> -------------------------------------------------------------------------
>
> Subject: r.blend: overwrites the output instead of 'Error: map exists.'
This happens because r.mapcalc is used which is not testing for
existing maps.
> As the title reads. Also, r.blend GUI misses the neat green progress bar.
AFAIK the progress bar is related to G_percent() output. No idea
how solve that...
Markus
|
|
Mon, May 1 2006
09:01:49
|
|
Mail sent by hamish_nospam@yahoo.com
|
|
Return-Path |
<hamish_nospam@yahoo.com>
|
Delivered-To |
grass-bugs@lists.intevation.de
|
Date |
Mon, 1 May 2006 19:01:21 +1200
|
From |
Hamish <hamish_nospam@yahoo.com>
|
To |
Request Tracker <grass-bugs@intevation.de>
|
Cc |
grass5@grass.itc.it
|
Subject |
Re: [GRASS5] [bug #4368] (grass) r.blend: overwrites the output instead of 'Error: map exists.'
|
Message-Id |
<20060501190121.0ae68615.hamish_nospam@yahoo.com>
|
In-Reply-To |
<20060429162736.21060101EEC@lists.intevation.de>
|
References |
<20060429162736.21060101EEC@lists.intevation.de>
|
X-Mailer |
Sylpheed version 1.0.4 (GTK+ 1.2.10; i386-pc-linux-gnu)
|
X-Face |
M<EoB)"*Z~u!,vFhXmw}R_KbdBta*P_=T|rbBL'e1/CQ9;/1g\BU3&!=y8ria$2Uk!HT&BB 8i?|X_+7~1jsy}F~g$2va%3fV`*=L(*cem[@3\yg,G,@rg6/QMJ
|
Mime-Version |
1.0
|
Content-Type |
text/plain; charset=US-ASCII
|
Content-Transfer-Encoding |
7bit
|
X-Spam-Status |
No, hits=-4.0 tagged_above=-999.0 required=3.0 tests=BAYES_00, FORGED_YAHOO_RCVD
|
X-Spam-Level |
|
> this bug's URL: http://intevation.de/rt/webrt?serial_num=4368
> ---------------------------------------------------------------------
>
> Subject: r.blend: overwrites the output instead of 'Error: map
> exists.'
..
> GRASS Version: 2006-04-23
>
> As the title reads.
fixed in cvs. As map name is created dynamically the parser doesn't
catch it with "gisprompt = new,cell,raster" ("new," not "old,"!)
I used g.findfile as the test,
for MAP in r g b ; do
g.findfile elem=cell file=${GIS_OPT_OUTPUT}.$MAP > /dev/null
if [ $? -eq 0 ] ; then
echo "Raster map <${GIS_OPT_OUTPUT}.$MAP> already exists." 1>&2
exit 1
fi
done
a few other cleanups, metadata tweaks done as well.
> Also, r.blend GUI misses the neat green progress bar.
This is because the module that creates the 100% is r.mapcalc which is
called by the script, not the GUI. The GUI parses G_percent(), not output
to stderr. No obvious solution.
Changing this bug to a wish:
g.parser should set (but not export) $GIS_OVERWRITE if the --o option
is passed to the script. Then we could test within the script.
alt, maybe better, we could test if
`g.gisenv get=OVERWRITE` -n && -eq 1 and then skip "exit 1" but keep the
warning. (be sure to read-only g.gisenv OVERWRITE)
see http://grass.ibiblio.org/grass61/manuals/html61_user/variables.html
Hamish
|
|
Mon, May 1 2006
09:01:58
|
|
Subject changed to g.parser: pass through --o by hbowman
|
|
Mon, May 1 2006
09:02:09
|
|
Area changed to wish6 by hbowman
|
|
Mon, May 1 2006
18:11:06
|
|
Mail sent by glynn@gclements.plus.com
|
|
Return-Path |
<glynn@gclements.plus.com>
|
Delivered-To |
grass-bugs@lists.intevation.de
|
From |
Glynn Clements <glynn@gclements.plus.com>
|
MIME-Version |
1.0
|
Content-Type |
text/plain; charset=us-ascii
|
Content-Transfer-Encoding |
7bit
|
Message-ID |
<17494.13076.348247.222426@cerise.gclements.plus.com>
|
Date |
Mon, 1 May 2006 17:11:00 +0100
|
To |
Markus Neteler <neteler@itc.it>
|
Cc |
Request Tracker <grass-bugs@intevation.de>, grass5@grass.itc.it
|
Subject |
Re: [GRASS5] [bug #4368] (grass) r.blend: overwrites the output instead of 'Error: map exists.'
|
In-Reply-To |
<20060429170056.GE14270@bartok.itc.it>
|
References |
<20060429162736.21060101EEC@lists.intevation.de> <20060429170056.GE14270@bartok.itc.it>
|
X-Mailer |
VM 7.07 under 21.4 (patch 15) "Security Through Obscurity" XEmacs Lucid
|
X-Spam-Status |
No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
|
X-Spam-Level |
|
Markus Neteler wrote:
> > Subject: r.blend: overwrites the output instead of 'Error: map exists.'
>
> This happens because r.mapcalc is used which is not testing for
> existing maps.
This happens because the r.blend script uses the "old" tag for its
output maps, so G_parser() doesn't check whether they already exist.
FWIW, I can add an explicit check to r.mapcalc to prevent overwriting,
if that is considered desirable.
--
Glynn Clements <glynn@gclements.plus.com>
|
|
Mon, May 1 2006
18:13:44
|
|
Mail sent by glynn@gclements.plus.com
|
|
Return-Path |
<glynn@gclements.plus.com>
|
Delivered-To |
grass-bugs@lists.intevation.de
|
From |
Glynn Clements <glynn@gclements.plus.com>
|
MIME-Version |
1.0
|
Content-Type |
text/plain; charset=us-ascii
|
Content-Transfer-Encoding |
7bit
|
Message-ID |
<17494.13236.7608.779886@cerise.gclements.plus.com>
|
Date |
Mon, 1 May 2006 17:13:40 +0100
|
To |
Hamish <hamish_nospam@yahoo.com>
|
Cc |
Request Tracker <grass-bugs@intevation.de>, grass5@grass.itc.it
|
Subject |
Re: [GRASS5] [bug #4368] (grass) r.blend: overwrites the output instead of 'Error: map exists.'
|
In-Reply-To |
<20060501190121.0ae68615.hamish_nospam@yahoo.com>
|
References |
<20060429162736.21060101EEC@lists.intevation.de> <20060501190121.0ae68615.hamish_nospam@yahoo.com>
|
X-Mailer |
VM 7.07 under 21.4 (patch 15) "Security Through Obscurity" XEmacs Lucid
|
X-Spam-Status |
No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
|
X-Spam-Level |
|
Hamish wrote:
> > Also, r.blend GUI misses the neat green progress bar.
>
> This is because the module that creates the 100% is r.mapcalc which is
> called by the script, not the GUI. The GUI parses G_percent(), not output
> to stderr. No obvious solution.
Huh? It shouldn't make any difference whether r.mapcalc is called
directly or via a script.
--
Glynn Clements <glynn@gclements.plus.com>
|
|
Tue, May 9 2006
19:22:13
|
|
Mail sent by msieczka
|
|
Now (CVS 2006-05-07) overwriting is not possible at all. In spite of the --o
switch r.blend keeps on saying:
r.blend --o first=obraz1 second=obraz2 out=kicha perc=75
Raster map <kicha.r> already exists.
Maciek
|
|
Tue, May 9 2006
21:36:01
|
|
Mail sent by cshock
|
|
parser.c now sets the OVERWRITE environment variable, but doesn't export it.
Scripts run by g.parser now have it set so that modules they run will be run
as if --o was included. It can be used here to skip the overwrite check that's
implemented in r.blend to check for .r .g and .b extensions to the map name. |
|
Wed, May 10 2006
03:36:30
|
|
Mail sent by glynn@gclements.plus.com
|
|
Return-Path |
<glynn@gclements.plus.com>
|
Delivered-To |
grass-bugs@lists.intevation.de
|
From |
Glynn Clements <glynn@gclements.plus.com>
|
MIME-Version |
1.0
|
Content-Type |
text/plain; charset=us-ascii
|
Content-Transfer-Encoding |
7bit
|
Message-ID |
<17505.17303.609975.51897@cerise.gclements.plus.com>
|
Date |
Wed, 10 May 2006 02:36:23 +0100
|
To |
Cedric Shock via RT <grass-bugs@intevation.de>
|
Cc |
werchowyna@epf.pl, grass-dev@grass.itc.it
|
Subject |
Re: [GRASS-dev] [bug #4368] (grass) g.parser: pass through --o
|
In-Reply-To |
<20060509193601.92C5D1005C2@lists.intevation.de>
|
References |
<20060509193601.92C5D1005C2@lists.intevation.de>
|
X-Mailer |
VM 7.07 under 21.4 (patch 15) "Security Through Obscurity" XEmacs Lucid
|
X-Spam-Status |
No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
|
X-Spam-Level |
|
Cedric Shock via RT wrote:
> parser.c now sets the OVERWRITE environment variable, but doesn't export it.
It doesn't make sense to talk about "exporting" an environment
variable.
More accurately, parser.c now sets the OVERWRITE environment variable
if either the OVERWRITE GRASS variable is set or if the --o switch is
used. It doesn't modify the OVERWRITE GRASS variable.
> Scripts run by g.parser now have it set so that modules they run will be run
> as if --o was included.
Only if the scripts themselves check $OVERWRITE and pass --o to any
commands which they run. G_parser() itself doesn't pay any attention
to the OVERWRITE environment variable.
--
Glynn Clements <glynn@gclements.plus.com>
|
|
Wed, May 10 2006
04:34:38
|
|
Mail sent by cedricgrass@shockfamily.net
|
|
Return-Path |
<cedricgrass@shockfamily.net>
|
Delivered-To |
grass-bugs@lists.intevation.de
|
From |
Cedric Shock <cedricgrass@shockfamily.net>
|
To |
Glynn Clements <glynn@gclements.plus.com>
|
Subject |
Re: [GRASS-dev] [bug #4368] (grass) g.parser: pass through --o
|
Date |
Tue, 9 May 2006 19:33:37 -0700
|
User-Agent |
KMail/1.8.3
|
Cc |
grass-dev@grass.itc.it, Cedric Shock via RT <grass-bugs@intevation.de>, werchowyna@epf.pl
|
References |
<20060509193601.92C5D1005C2@lists.intevation.de> <17505.17303.609975.51897@cerise.gclements.plus.com>
|
In-Reply-To |
<17505.17303.609975.51897@cerise.gclements.plus.com>
|
MIME-Version |
1.0
|
Content-Type |
text/plain; charset="iso-8859-1"
|
Content-Transfer-Encoding |
7bit
|
Content-Disposition |
inline
|
Message-Id |
<200605091933.38760.cedricgrass@shockfamily.net>
|
X-Spam-Status |
No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
|
X-Spam-Level |
|
Glynn,
> Cedric Shock via RT wrote:
> > parser.c now sets the OVERWRITE environment variable, but doesn't export
> > it.
In bug 4331 you wrote:
> I would have thought that it would be sufficient for G_parser() to set
> OVERWRITE itself if --o was used. That would then be inherited by the
> script and by any modules which it calls.
Would this be G__setenv("OVERWRITE", "1") ? Or will something like:
r.patch --o ...
r.in.gdal output=map_that_already_exists ...
overwrite the map_that_already_exists because the "env" changed?
>
> More accurately, parser.c now sets the OVERWRITE environment variable
> if either the OVERWRITE GRASS variable is set or if the --o switch is
> used. It doesn't modify the OVERWRITE GRASS variable.
>
Is the above how to modify this like you suggested?
--Cedric
|
|
Wed, May 10 2006
06:40:27
|
|
Mail sent by glynn@gclements.plus.com
|
|
Return-Path |
<glynn@gclements.plus.com>
|
Delivered-To |
grass-bugs@lists.intevation.de
|
From |
Glynn Clements <glynn@gclements.plus.com>
|
MIME-Version |
1.0
|
Content-Type |
text/plain; charset=us-ascii
|
Content-Transfer-Encoding |
7bit
|
Message-ID |
<17505.28333.971593.486068@cerise.gclements.plus.com>
|
Date |
Wed, 10 May 2006 05:40:13 +0100
|
To |
Cedric Shock <cedricgrass@shockfamily.net>
|
Cc |
Cedric Shock via RT <grass-bugs@intevation.de>, grass-dev@grass.itc.it, werchowyna@epf.pl
|
Subject |
Re: [GRASS-dev] [bug #4368] (grass) g.parser: pass through --o
|
In-Reply-To |
<200605091933.38760.cedricgrass@shockfamily.net>
|
References |
<20060509193601.92C5D1005C2@lists.intevation.de> <17505.17303.609975.51897@cerise.gclements.plus.com> <200605091933.38760.cedricgrass@shockfamily.net>
|
X-Mailer |
VM 7.07 under 21.4 (patch 15) "Security Through Obscurity" XEmacs Lucid
|
X-Spam-Status |
No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
|
X-Spam-Level |
|
Cedric Shock wrote:
> > > parser.c now sets the OVERWRITE environment variable, but doesn't export
> > > it.
>
> In bug 4331 you wrote:
>
> > I would have thought that it would be sufficient for G_parser() to set
> > OVERWRITE itself if --o was used. That would then be inherited by the
> > script and by any modules which it calls.
Sorry. When I wrote that, I was under the impression that OVERWRITE
was an environment variable.
> Would this be G__setenv("OVERWRITE", "1") ?
That would work, but it's the wrong approach, as the change would be
persistent ...
> Or will something like:
>
> r.patch --o ...
> r.in.gdal output=map_that_already_exists ...
>
> overwrite the map_that_already_exists because the "env" changed?
Exactly.
> > More accurately, parser.c now sets the OVERWRITE environment variable
> > if either the OVERWRITE GRASS variable is set or if the --o switch is
> > used. It doesn't modify the OVERWRITE GRASS variable.
>
> Is the above how to modify this like you suggested?
What I would suggest is to change G_parser() to:
1. Set the "overwrite" C variable if any of the following are
true:
a) The --o switch is used.
b) The OVERWRITE GRASS variable is set.
c) The OVERWRITE environment variable is set
2. Set the OVERWRITE environment variable from the "overwrite" C
variable.
1a) provides a means for the user to enable overwriting for a single
command. 1b) provides a means for the user to enable overwriting in a
persistent manner. 1c) provides a mechanism to make the --o switch to
do the right thing for scripts (and C programs which invoke other
modules via system(); there are a few of those).
More generally, environment variables should be used for parameters
where you might want a different setting for individual commands. Each
process has its own set of environment variables, but there is only
one set of GRASS variables.
OTOH, GRASS variables should be used where you want to be able to
enable or disable them for the session as a whole from a command. You
can't do this with environment variables, as only the shell can change
its own environment.
In terms of confusion between the two types of variables, it doesn't
help that the libgis functions which manipulate GRASS variables have
"env" in their names and are defined in a file called env.c (and the
documentation used to refer to them as "environment variables"; maybe
some still does?).
One of the biggest issues with integrating GRASS modules into a
higher-level architecture (e.g. the GUI) is the extensive use of state
stored in files (and the rather ad-hoc way in which this is done).
While this is a good idea from the perspective of a command-line
session (you wouldn't want to have to type database=... location=...
mapset=... region=... for every command, along with monitor=... for
d.* commands), it's a nuisance if you want to be able to run multiple
commands concurrently (e.g. running commands from gis.m when the user
might also be running commands from the shell) or if you want multiple
contexts (e.g. one for each gis.m display).
Actually, the "fixes" have also been rather ad-hoc. It might be better
to do away with WIND and store the name of a saved region in $GISRC
instead, remove MONITOR_OVERRIDE and WIND_OVERRIDE, and just create an
alternate $GISRC file whenever you want to change any of those
parameters.
--
Glynn Clements <glynn@gclements.plus.com>
|
|
Wed, May 10 2006
07:28:18
|
|
Mail sent by cedricgrass@shockfamily.net
|
|
Return-Path |
<cedricgrass@shockfamily.net>
|
Delivered-To |
grass-bugs@lists.intevation.de
|
From |
Cedric Shock <cedricgrass@shockfamily.net>
|
To |
grass-dev@grass.itc.it
|
Subject |
Re: [GRASS-dev] [bug #4368] (grass) g.parser: pass through --o
|
Date |
Tue, 9 May 2006 22:27:18 -0700
|
User-Agent |
KMail/1.8.3
|
Cc |
Glynn Clements <glynn@gclements.plus.com>, Cedric Shock via RT <grass-bugs@intevation.de>, werchowyna@epf.pl
|
References |
<20060509193601.92C5D1005C2@lists.intevation.de> <200605091933.38760.cedricgrass@shockfamily.net> <17505.28333.971593.486068@cerise.gclements.plus.com>
|
In-Reply-To |
<17505.28333.971593.486068@cerise.gclements.plus.com>
|
MIME-Version |
1.0
|
Content-Type |
text/plain; charset="iso-8859-1"
|
Content-Transfer-Encoding |
7bit
|
Content-Disposition |
inline
|
Message-Id |
<200605092227.19458.cedricgrass@shockfamily.net>
|
X-Spam-Status |
No, hits=-4.9 tagged_above=-999.0 required=3.0 tests=BAYES_00
|
X-Spam-Level |
|
Glynn,
> [Too much to quote]
That's some crystal clear thinking there. parser.c now does the following:
Decides to overwrite if:
a.) --o switch is present (to force for one command)
b.) If the grass variable OVERWRITE is set to 1 (to force for all commands)
c.) If the GRASS_OVERWRITE environment variable is set to 1 (so that commands
run from scripts, system, etc. pick up on the original --o override)
When parser.c decides to overwrite it sets the GRASS_OVERWRITE environment
variable to 1. This can be used in scripts like this one.
The OVERWRITE environment variable is no more (it never existed before my
missed attempt).
GRASS_OVERWRITE is documented in variables.htm*
--Cedric
|
|
Sun, Jun 11 2006
14:31:47
|
|
Mail sent by msieczka
|
|
The bug is fixed I think, but I don't understand all the issues touched in the
discussion. Anyway, as it "works for me", I'm taking the liberty to close it.
Please re-open if needed.
Maciek
|
|
Sun, Jun 11 2006
14:31:51
|
|
Status changed to resolved by msieczka
|
|