[GRASS-dev] [GRASS GIS] #1836: r.reclass.eq reports r.reclass rules file missing

#1836: r.reclass.eq reports r.reclass rules file missing
---------------------+------------------------------------------------------
Reporter: cwren | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: | Platform: MSWindows 7
      Cpu: x86-64 |
---------------------+------------------------------------------------------
r.reclass.eq gives an error referring to a missing rules file and fails to
produce an output. Using osgeo4w's grass70dev 7.0.svn-r54261-436

r.rescale.eq --overwrite input=test@PERMANENT output=testout to=1,100
Reading test@PERMANENT ...
Description:
  Reclassify raster map based on category values.
  Creates a new raster map whose category values are based
upon a reclassification of the categories in an existing
raster map.
Keywords:
  raster, reclassification
Usage:
  r.reclass input=name output=name rules=name [title=string]
    [--overwrite] [--verbose] [--quiet]
Flags:
  --o Allow output files to overwrite existing files
  --v Verbose module output
  --q Quiet module output
Parameters:
    input Name of raster map to be reclassified
   output Name for output raster map
    rules File containing reclass rules
             "-" to read from stdin
    title Title for the resulting raster map
ERROR: Required parameter <rules> not set:
         (File containing reclass rules)
Rescale test@PERMANENT[-5644,5207] to testout[1,100]

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

#1836: r.reclass.eq reports r.reclass rules file missing
---------------------+------------------------------------------------------
Reporter: cwren | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: | Platform: MSWindows 7
      Cpu: x86-64 |
---------------------+------------------------------------------------------

Comment(by neteler):

{{{
grep G_popen_write */*.c
r.mode/main.c: reclass = G_popen_write(&reclass_child, "r.reclass",
args);
r.rescale.eq/main.c: fp = G_popen_write(&child, "r.reclass", args);
r.rescale/main.c: fp = G_popen_write(&child, "r.reclass", args);
r.statistics/run_cmd.c: fp = G_popen_write(child, argv[0], argv);
}}}

The usage of argv and args of G_popen_write() is not the same, desired?

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

#1836: r.reclass.eq reports r.reclass rules file missing
---------------------+------------------------------------------------------
Reporter: cwren | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: | Platform: MSWindows 7
      Cpu: x86-64 |
---------------------+------------------------------------------------------

Comment(by glynn):

Replying to [ticket:1836 cwren]:
> r.reclass.eq gives an error referring to a missing rules file and fails
to produce an output.

It's actually r.rescale.eq, not r.reclass.eq.

It hasn't been updated since r.reclass' rules= option became mandatory.
r.rescale was fixed with r45358; r.rescale.eq needs the same treatment.

BTW, there's no need to sprintf() the string into a buffer; using a string
literal will work.

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

#1836: r.reclass.eq reports r.reclass rules file missing
---------------------+------------------------------------------------------
Reporter: cwren | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: | Platform: MSWindows 7
      Cpu: x86-64 |
---------------------+------------------------------------------------------

Comment(by neteler):

Replying to [comment:2 glynn]:
> It hasn't been updated since r.reclass' rules= option became mandatory.
r.rescale was fixed with r45358; r.rescale.eq needs the same treatment.

Done in r54322. The tomorrow's binary snapshot will contain the fix.

> BTW, there's no need to sprintf() the string into a buffer; using a
string literal will work.

Still open.

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