Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#3453 closed defect (fixed)

i.segment.stats add-on : Empty output csv when flags ‘s’ is activated

Reported by: tgrippa Owned by: grass-dev@…
Priority: normal Milestone:
Component: Addons Version: unspecified
Keywords: i.segment.stats Cc: mlennert
CPU: Unspecified Platform: Unspecified

Description

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[x] for x in stat_indices]
else:
 output_dict[values[0]] = [values[x] for x in stat_indices]

and shoud be :

output_dict[values[0]] = output_dict[values[0]]+ [values[x] 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,

Change History (2)

comment:1 by mlennert, 6 years ago

Resolution: fixed
Status: newclosed

In 71822:

i.segment.stats: fix #3453 and object error output

comment:2 by mlennert, 6 years ago

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.

Note: See TracTickets for help on using tickets.