Opened 16 years ago

Closed 12 years ago

Last modified 12 years ago

#115 closed enhancement (wontfix)

r.statistics: allow output to file and frequency count

Reported by: mlennert Owned by: grass-dev@…
Priority: normal Milestone: 7.0.0
Component: Default Version: svn-trunk
Keywords: Cc:
CPU: Unspecified Platform: Unspecified

Description

It would be great if r.statistics was enhanced with the following:

  • allow output to file, not only output to stdout
  • add option for distribution frequency count, not only distribution percentages

Change History (7)

comment:1 by neteler, 12 years ago

CPU: Unspecified
Milestone: 6.4.07.0.0
Platform: Unspecified
Priority: majornormal

The parameter

output Resultant raster map (not used with 'distribution')

has been added a while ago.

"distribution frequency count" is not yet available.

in reply to:  1 ; comment:2 by mlennert, 12 years ago

Replying to neteler:

The parameter

output Resultant raster map (not used with 'distribution')

has been added a while ago.

IIRC, instead of a raster file output, I meant a text file output of the statistics, giving you something like this:

BaseValue StatisticOfCoverValue

e.g. for each land class type of landuse96_28m give me the average elevation.

Something like the file options in v.db.select for example.

"distribution frequency count" is not yet available.

This shouldn't be too difficult to add. Don't have the time to do this now, but in raster/r.statistics/o_distrib.c it should suffice to direct the content of the fd2 tempfile to the output file.

Moritz

in reply to:  2 ; comment:3 by mlennert, 12 years ago

Replying to mlennert:

Replying to neteler:

"distribution frequency count" is not yet available.

This shouldn't be too difficult to add. Don't have the time to do this now, but in raster/r.statistics/o_distrib.c it should suffice to direct the content of the fd2 tempfile to the output file.

Just noticed that I was looking at grass6dev. In grass7 there is no o_distrib.c anymore, and no 'distribution' method. Why was this taken out ? Redundancy with r.stats ?

Moritz

in reply to:  3 ; comment:4 by glynn, 12 years ago

Replying to mlennert:

Just noticed that I was looking at grass6dev. In grass7 there is no o_distrib.c anymore, and no 'distribution' method. Why was this taken out ? Redundancy with r.stats ?

It was removed in r40648. I suspect that the reason was that it doesn't behave like any of the other methods. Rather than generating an output map, it just prints statistics to stdout. If the functionality is desired, it should probably be in a separate r.distribution module.

in reply to:  4 ; comment:5 by mlennert, 12 years ago

Resolution: wontfix
Status: newclosed

Replying to glynn:

Replying to mlennert:

Just noticed that I was looking at grass6dev. In grass7 there is no o_distrib.c anymore, and no 'distribution' method. Why was this taken out ? Redundancy with r.stats ?

It was removed in r40648. I suspect that the reason was that it doesn't behave like any of the other methods. Rather than generating an output map, it just prints statistics to stdout. If the functionality is desired, it should probably be in a separate r.distribution module.

I understand the logic and am closing this ticket as wontfix. I guess what I was looking for would be more an enhancement of r.stats / r.reports to provide different types of statistics of a cover map for different categories of a base map (e.g. what is the range, stdev, min, max, whatever of elevation in class 1 of my landcover map ?).

Moritz

in reply to:  5 ; comment:6 by mmetz, 12 years ago

Replying to mlennert:

Replying to glynn:

Replying to mlennert:

Just noticed that I was looking at grass6dev. In grass7 there is no o_distrib.c anymore, and no 'distribution' method. Why was this taken out ? Redundancy with r.stats ?

It was removed in r40648. I suspect that the reason was that it doesn't behave like any of the other methods. Rather than generating an output map, it just prints statistics to stdout. If the functionality is desired, it should probably be in a separate r.distribution module.

I understand the logic and am closing this ticket as wontfix. I guess what I was looking for would be more an enhancement of r.stats / r.reports to provide different types of statistics of a cover map for different categories of a base map (e.g. what is the range, stdev, min, max, whatever of elevation in class 1 of my landcover map ?).

Some of that can be done with r.univar which also allows output to file. I am not sure if this is what you mean.

Markus M

in reply to:  6 comment:7 by mlennert, 12 years ago

Replying to mmetz:

Replying to mlennert:

I understand the logic and am closing this ticket as wontfix. I guess what I was looking for would be more an enhancement of r.stats / r.reports to provide different types of statistics of a cover map for different categories of a base map (e.g. what is the range, stdev, min, max, whatever of elevation in class 1 of my landcover map ?).

Some of that can be done with r.univar which also allows output to file. I am not sure if this is what you mean.

Wow, once again a functionality which has been in the code for almost 2 years without me noticing. GRASS never ceases to surprise... (In case others are looking for the functionality: it's the 'zones' parameter present since 6.4.2).

Thanks !

Moritz

Note: See TracTickets for help on using tickets.