[GRASS-dev] [GRASS GIS] #3453: i.segment.stats add-on : Empty output csv when flags ‘s’ is activated

#3453: i.segment.stats add-on : Empty output csv when flags ‘s’ is activated
-----------------------------+-------------------------
Reporter: tgrippa | Owner: grass-dev@…
     Type: defect | Status: new
Priority: normal | Milestone:
Component: Addons | Version: unspecified
Keywords: i.segment.stats | CPU: Unspecified
Platform: Unspecified |
-----------------------------+-------------------------
Hi, I notice a bug in i.segment.stats. When using the ‘s’ flag, the output
csv is empty (in fact, the header is written, but not the rest of the
file).

I check the code I think the problem comes from L222-225 which are:

{{{
if area_measures:
  output_dict[values[0]] = output_dict[values[0]]+ [values for x in
stat_indices]
else:
  output_dict[values[0]] = [values for x in stat_indices]
}}}

and shoud be :
{{{
output_dict[values[0]] = output_dict[values[0]]+ [values for x in
stat_indices]
}}}

I make the change on my local version of the add-on and it seems working
as expected.

Also, I noticed the L220 and L221 are duplicates.

Cheers,

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

#3453: i.segment.stats add-on : Empty output csv when flags ‘s’ is activated
--------------------------+-----------------------------
  Reporter: tgrippa | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone:
Component: Addons | Version: unspecified
Resolution: fixed | Keywords: i.segment.stats
       CPU: Unspecified | Platform: Unspecified
--------------------------+-----------------------------
Changes (by mlennert):

* status: new => closed
* resolution: => fixed

Comment:

In [changeset:"71822" 71822]:
{{{
#!CommitTicketReference repository="" revision="71822"
i.segment.stats: fix #3453 and object error output
}}}

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

#3453: i.segment.stats add-on : Empty output csv when flags ‘s’ is activated
--------------------------+-----------------------------
  Reporter: tgrippa | Owner: grass-dev@…
      Type: defect | Status: closed
  Priority: normal | Milestone:
Component: Addons | Version: unspecified
Resolution: fixed | Keywords: i.segment.stats
       CPU: Unspecified | Platform: Unspecified
--------------------------+-----------------------------

Comment (by mlennert):

Thanks for the report and fix. The issue also put the light on another
bug in the object error message output. Both should be fixed in r71822.
Please test.

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