[GRASS-dev] [GRASS GIS] #115: r.statistics: allow output to file and frequency count

#115: r.statistics: allow output to file and frequency count
-------------------------+--------------------------------------------------
Reporter: mlennert | Owner: grass-dev@lists.osgeo.org
     Type: enhancement | Status: new
Priority: major | Milestone: 6.4.0
Component: default | Version: svn-trunk
Keywords: |
-------------------------+--------------------------------------------------
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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/115&gt;
GRASS GIS <http://grass.osgeo.org>
GRASS Geographic Information System (GRASS GIS) - http://grass.osgeo.org/

#115: r.statistics: allow output to file and frequency count
-------------------------+--------------------------------------------------
Reporter: mlennert | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------
Changes (by neteler):

  * priority: major => normal
  * platform: => Unspecified
  * cpu: => Unspecified
  * milestone: 6.4.0 => 7.0.0

Comment:

The parameter

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

has been added a while ago.

"distribution frequency count" is not yet available.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/115#comment:1&gt;
GRASS GIS <http://grass.osgeo.org>

#115: r.statistics: allow output to file and frequency count
-------------------------+--------------------------------------------------
Reporter: mlennert | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by mlennert):

Replying to [comment:1 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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/115#comment:2&gt;
GRASS GIS <http://grass.osgeo.org>

#115: r.statistics: allow output to file and frequency count
-------------------------+--------------------------------------------------
Reporter: mlennert | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by mlennert):

Replying to [comment:2 mlennert]:
> Replying to [comment:1 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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/115#comment:3&gt;
GRASS GIS <http://grass.osgeo.org>

#115: r.statistics: allow output to file and frequency count
-------------------------+--------------------------------------------------
Reporter: mlennert | Owner: grass-dev@…
     Type: enhancement | Status: new
Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Keywords: | Platform: Unspecified
      Cpu: Unspecified |
-------------------------+--------------------------------------------------

Comment(by glynn):

Replying to [comment:3 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.

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/115#comment:4&gt;
GRASS GIS <http://grass.osgeo.org>

#115: r.statistics: allow output to file and frequency count
--------------------------+-------------------------------------------------
  Reporter: mlennert | Owner: grass-dev@…
      Type: enhancement | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Resolution: wontfix | Keywords:
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------
Changes (by mlennert):

  * status: new => closed
  * resolution: => wontfix

Comment:

Replying to [comment:4 glynn]:
> Replying to [comment:3 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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/115#comment:5&gt;
GRASS GIS <http://grass.osgeo.org>

#115: r.statistics: allow output to file and frequency count
--------------------------+-------------------------------------------------
  Reporter: mlennert | Owner: grass-dev@…
      Type: enhancement | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Resolution: wontfix | Keywords:
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------

Comment(by mmetz):

Replying to [comment:5 mlennert]:
> Replying to [comment:4 glynn]:
> > Replying to [comment:3 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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/115#comment:6&gt;
GRASS GIS <http://grass.osgeo.org>

#115: r.statistics: allow output to file and frequency count
--------------------------+-------------------------------------------------
  Reporter: mlennert | Owner: grass-dev@…
      Type: enhancement | Status: closed
  Priority: normal | Milestone: 7.0.0
Component: Default | Version: svn-trunk
Resolution: wontfix | Keywords:
  Platform: Unspecified | Cpu: Unspecified
--------------------------+-------------------------------------------------

Comment(by mlennert):

Replying to [comment:6 mmetz]:
> Replying to [comment:5 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

--
Ticket URL: <http://trac.osgeo.org/grass/ticket/115#comment:7&gt;
GRASS GIS <http://grass.osgeo.org>