Opened 12 years ago

Closed 8 years ago

Last modified 8 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 Changed 8 years ago by neteler

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.

comment:2 in reply to:  1 ; Changed 8 years ago by mlennert

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

comment:3 in reply to:  2 ; Changed 8 years ago by mlennert

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

comment:4 in reply to:  3 ; Changed 8 years ago by 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.

comment:5 in reply to:  4 ; Changed 8 years ago by mlennert

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

comment:6 in reply to:  5 ; Changed 8 years ago by mmetz

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

comment:7 in reply to:  6 Changed 8 years ago by mlennert

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.