Opened 7 years ago

Last modified 5 years ago

#3475 new defect

r.mapcalc expression does not accept fully qualified map name as an output

Reported by: marisn Owned by: grass-dev@…
Priority: minor Milestone: 7.6.2
Component: Raster Version: svn-trunk
Keywords: r.mapcalc Cc:
CPU: Unspecified Platform: Unspecified

Description

All raster and vector modules should accept fully qualified map name as an output parameter and ignore @mapset part as long as mapset == current mapset. This is implemented in Vect_open_new() and G_open_raster_new(). Still r.mapcalc is failing with an error:

mapcalc> sample@mapset=1
syntax error, unexpected '@', expecting '('

See extra discussion at bug #676 I'll try to fix r.grow code to strip @mapset part as a workaround as at the moment it fails to overwrite an existing map when called from WXGUI.

Change History (3)

comment:1 by martinl, 7 years ago

Milestone: 7.2.4

comment:2 by Nikos Alexandris, 6 years ago

Is there any activity on this? I have the following pending for a recently published add-on:

/osgeo/grasstrunk/dist.x86_64-pc-linux-gnu/scripts/r.estimap.recreation --overwrite land=land_suitability@examples potential=potential
syntax error, unexpected '@', expecting '('
Parse error
ERROR: parse error
Traceback (most recent call last):
  File "/osgeo/grasstrunk/dist.x86_64-pc-linux-
gnu/scripts/r.estimap.recreation", line 4103, in <module>
    sys.exit(main())
  File "/osgeo/grasstrunk/dist.x86_64-pc-linux-
gnu/scripts/r.estimap.recreation", line 3631, in main
    r.mapcalc(subset_land)
  File "/osgeo/grasstrunk/dist.x86_64-pc-linux-
gnu/etc/python/grass/pygrass/modules/interface/module.py",
line 651, in __call__
    return self.run()
  File "/osgeo/grasstrunk/dist.x86_64-pc-linux-
gnu/etc/python/grass/pygrass/modules/interface/module.py",
line 772, in run
    self.wait()
  File "/osgeo/grasstrunk/dist.x86_64-pc-linux-
gnu/etc/python/grass/pygrass/modules/interface/module.py",
line 797, in wait
    module=self.name, errors=stderr)
grass.exceptions.CalledModuleError: Module run r.mapcalc
r.mapcalc expression=tmp.5319.8.land_suitability@examples =
land_suitability@examples region=current ended with error
Process ended with non-zero return code 1. See errors in the
(error) output.
Removing temporary files

Reading Glynn's last comment https://trac.osgeo.org/grass/ticket/676#comment:12, do I understand correctly that I should take care to strip '@mapset' part at the add-on/module level?

comment:3 by martinl, 5 years ago

Milestone: 7.2.47.6.2
Note: See TracTickets for help on using tickets.