[GRASS-dev] [bug #3069] (grass) r.mapcalc - warning/errorr amibiguity

r.mapcalc still prints this double information in case 2 same called rasters
exit within the accesible mapsets, eg.:

WARNING: 'cell/map' was found in more mapsets (also found in nic).
ERROR: 'cell/map' was found in more mapsets (also found in nic).

Moreover, in such case r.mapcalc exits with status 1. Could it be bad for scripts?

Maciek

-------------------------------------------- Managed by Request Tracker

Maciek Sieczka via RT wrote:

r.mapcalc still prints this double information in case 2 same called
rasters exit within the accesible mapsets, eg.:

WARNING: 'cell/map' was found in more mapsets (also found in nic).
ERROR: 'cell/map' was found in more mapsets (also found in nic).

Moreover, in such case r.mapcalc exits with status 1. Could it be bad
for scripts?

(not commenting on the bug, just the symptoms)

exit code of 1 is appropriate if the module exited with an ERROR.

If the system found an ambiguity, it is better to stop with an error
than pick the wrong map and potentially mess up the data without the
user noticing.

Hamish

Maciek Sieczka via RT wrote:

r.mapcalc still prints this double information in case 2 same called rasters
exit within the accesible mapsets, eg.:

WARNING: 'cell/map' was found in more mapsets (also found in nic).
ERROR: 'cell/map' was found in more mapsets (also found in nic).

r.mapcalc uses G_set_error_routine() to install an error handler; the
error handler calls G_fatal_error() regardless of the value of the
"fatal" argument.

I'll fix this.

Moreover, in such case r.mapcalc exits with status 1. Could it be bad for scripts?

This is correct for an error.

--
Glynn Clements <glynn@gclements.plus.com>

On 05/03/07 23:24, Hamish wrote:

Maciek Sieczka via RT wrote:

r.mapcalc still prints this double information in case 2 same called
rasters exit within the accesible mapsets, eg.:

WARNING: 'cell/map' was found in more mapsets (also found in nic).

As I've mentioned before somewhere, I find this message a bit confusing, especially the "also found in" which normally gives me the mapset I am in and want to use the map of (at least it does so when in mapset user1 of spearfish working on a local copy of a map which is also in PERMANENT).

Couldn't this be changed so that it mentions the _other_ mapsets the map is in, and maybe mention which map is used by default (I know that in this case it stops with an error, but many other modules just emit this as a warning, leaving the user uninformed of which map was used) ?

Moritz

Moritz Lennert wrote:

>> r.mapcalc still prints this double information in case 2 same called
>> rasters exit within the accesible mapsets, eg.:
>>
>> WARNING: 'cell/map' was found in more mapsets (also found in nic).

As I've mentioned before somewhere, I find this message a bit confusing,
especially the "also found in" which normally gives me the mapset I am
in and want to use the map of (at least it does so when in mapset user1
of spearfish working on a local copy of a map which is also in PERMANENT).

Couldn't this be changed so that it mentions the _other_ mapsets the map
is in, and maybe mention which map is used by default (I know that in
this case it stops with an error, but many other modules just emit this
as a warning, leaving the user uninformed of which map was used) ?

I've changed it so that it identifies all of the mapsets involved,
e.g.:

  $ r.resample in=fields out=fields
  Creating support files for fields...
  creating new cats file...
  $ r.mapcalc foo = fields
  WARNING: 'cell/fields' was found in more mapsets (also found in PERMANENT).
  WARNING: using 'fields@glynn'.

--
Glynn Clements <glynn@gclements.plus.com>

On 06/03/07 11:45, Glynn Clements wrote:

Moritz Lennert wrote:

r.mapcalc still prints this double information in case 2 same called
rasters exit within the accesible mapsets, eg.:

WARNING: 'cell/map' was found in more mapsets (also found in nic).

As I've mentioned before somewhere, I find this message a bit confusing, especially the "also found in" which normally gives me the mapset I am in and want to use the map of (at least it does so when in mapset user1 of spearfish working on a local copy of a map which is also in PERMANENT).

Couldn't this be changed so that it mentions the _other_ mapsets the map is in, and maybe mention which map is used by default (I know that in this case it stops with an error, but many other modules just emit this as a warning, leaving the user uninformed of which map was used) ?

I've changed it so that it identifies all of the mapsets involved,
e.g.:

  $ r.resample in=fields out=fields
  Creating support files for fields...
  creating new cats file...
  $ r.mapcalc foo = fields
  WARNING: 'cell/fields' was found in more mapsets (also found in PERMANENT).
  WARNING: using 'fields@glynn'.

Great, thanks !

Moritz