Opened 10 years ago

Closed 10 years ago

#2180 closed defect (fixed)

r.li.shannon - r.li.pielou

Reported by: matmar Owned by: grass-dev@…
Priority: normal Milestone: 6.4.4
Component: Raster Version: unspecified
Keywords: r.li.shannon, r.li.pielou Cc:
CPU: x86-64 Platform: Linux

Description

Hi,

r.li.shannon (and consequently r.li.pielou) returns the wrong output when "Whole Maplayer / Select areas from the overlayed vector map" option is used to build the configuration file. I attached everything's needed to replicate the error (with r.li.shannon).

example.ascii Simulated Landcover map.

example_vect Polygon used to calculate the index.

conf r.li.setup configuration file built using "Selet areas from the overlayed vector map" option. (Wrong shannon index).

conf_whole_whole r.li.setup configuration file built using "Whole Maplayer / Whole Maplayer" option. (Correct Shannon index).

Formula to calculate the correct Shannon index for the example landscape (paste it in R):

-(((10/16)*log(10/16))+((2/16)*log(2/16))+((1/16)*log(1/16))+((3/16)*log(3/16)))

Cheers,
Matteo

Attachments (4)

conf (136 bytes ) - added by matmar 10 years ago.
conf
conf_whole_whole (49 bytes ) - added by matmar 10 years ago.
example.ascii (280 bytes ) - added by matmar 10 years ago.
example_vect.pack (1.2 KB ) - added by matmar 10 years ago.

Download all attachments as: .zip

Change History (8)

by matmar, 10 years ago

Attachment: conf added

conf

by matmar, 10 years ago

Attachment: conf_whole_whole added

by matmar, 10 years ago

Attachment: example.ascii added

by matmar, 10 years ago

Attachment: example_vect.pack added

comment:1 by matmar, 10 years ago

Before testing it you have to patch r.li modules with the patch included in #2024

in reply to:  description ; comment:2 by mmetz, 10 years ago

Replying to matmar:

r.li.shannon (and consequently r.li.pielou) returns the wrong output when "Whole Maplayer / Select areas from the overlayed vector map" option is used to build the configuration file.

r.li.shannon as well as related modules (dominance, pielou, renyi, simpson) are fixed in trunk r59072.

in reply to:  2 comment:3 by mmetz, 10 years ago

Replying to mmetz:

Replying to matmar:

r.li.shannon (and consequently r.li.pielou) returns the wrong output when "Whole Maplayer / Select areas from the overlayed vector map" option is used to build the configuration file.

r.li.shannon as well as related modules (dominance, pielou, renyi, simpson) are fixed in trunk r59072.

After more testing and bugfixing with matmar, the r.li modules seem to be stable in G7: no more crashes, and the results are in our tests correct. While the r.li.setup replacement in G7 is still work in progress, r.li.setup in G6 works, but all other r.li modules in G6 must be considered as not functional. With luck, they don't crash, and with even more luck, the result is correct, but most likely it is not.

comment:4 by neteler, 10 years ago

Resolution: fixed
Status: newclosed

Rewrite from trunk backported in r59304.

Closing here, continued in bug #1214.

Note: See TracTickets for help on using tickets.