[GRASS-dev] [GRASS GIS] #1528: r.mapcalc within a FCELL mask cell_values_float: xdr_float failed

#1528: r.mapcalc within a FCELL mask cell_values_float: xdr_float failed
----------------------+-----------------------------------------------------
Reporter: pertusus | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: | Platform: Linux
      Cpu: x86-64 |
----------------------+-----------------------------------------------------
This is not a very reproducible bug, but intermitently reproducible. I do
a FCELL mask, with
{{{
r.circle output=circle10 coordinate=$x,$y min=0 max=10000
echo "$x|$y|1" | r.in.xyz input=- output=seed
r.patch input=seed,circle10 output=circle10_seed
}}}

and after the mask is set, a r.mapcalc gives:
{{{
r.mask circle10_seed
r.mapcalc "result_$nr = continent_fa - circle10_seed"
ERROR: cell_values_float: xdr_float failed for index 47
}}}

This is not so easily reproduced, to reproduce it I need the continent_fa
map which is a flow accumulation map from hydro1k...

I attach a tarball to reproduce the issue. First you need to run

{{{
./prepare_hydro1k.sh
}}}
which downloads using wget, and unpack.

Then you can test with
{{{
./lambert_map.sh
}}}

The r.mapcalc is in a loop because it doesn't error each time.

If the mask is CELL, for instance by using:
{{{
echo "$x|$y|1" | r.in.xyz input=- output=seed type=CELL
}}}
there is no error.

There is no such error with 6.4.

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

#1528: r.mapcalc within a FCELL mask cell_values_float: xdr_float failed
----------------------+-----------------------------------------------------
Reporter: pertusus | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: | Platform: Linux
      Cpu: x86-64 |
----------------------+-----------------------------------------------------

Comment(by pertusus):

You need to have #1525 fixed to be able to have a FCELL mask.

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

#1528: r.mapcalc within a FCELL mask cell_values_float: xdr_float failed
-----------------------+----------------------------------------------------
  Reporter: pertusus | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Resolution: fixed | Keywords: xdr, r.mapcalc
  Platform: Linux | Cpu: x86-64
-----------------------+----------------------------------------------------
Changes (by neteler):

  * keywords: => xdr, r.mapcalc
  * status: new => closed
  * resolution: => fixed

Comment:

The issue got solved since XDR was removed from raster2D in GRASS GIS 7:

{{{
[neteler@oboe bug_grass_mask_mapcalc]$ sh lambert_map.sh
  100%
r.circle complete. Raster map <circle10> created.
Reading input data...
  100%
Writing to output raster map...
  100%
r.in.xyz complete. 1 points found in region.
  100%
All subsequent raster operations will be limited to the MASK area.
Removing
or renaming raster map named 'MASK' will restore raster operations to
normal.
  100%
  100%
  100%
  100%
  100%
  100%
  100%
  100%
  100%
  100%
  100%
[neteler@oboe bug_grass_mask_mapcalc]$
}}}

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