grass icon indicating copy to clipboard operation
grass copied to clipboard

r.kappa fixes

Open marisn opened this issue 2 years ago • 1 comments

r.kappa has some strange design decisions and produces strange or outright wrong output if input data doesn't match its expectations. This PR fixes:

  • printing garbage instead of NA for the first raster category for commision, ommision and kappa values;
  • printing raster category values if labels are missing for matrix-only output mode;

marisn avatar Sep 09 '22 14:09 marisn

GCC and CodeQL are not happy. Otherwise no idea without testing or tests, sorry.

There are more issues as some values are calculated incorrectly if input data is not sequential numbers starting at 0. Thus just a draft as more work is needed.

Probably another candidate for JSON output, but that's out of scope for this PR.

I was thinking of shell script style with "-g" flag, but going for JSON also is an option. In separate PR, of course, after this PR is merged as this PR will have to be backported.

marisn avatar Sep 14 '22 19:09 marisn