[GRASS-dev] Re: [GRASS GIS] #475: r.stats: last bin always has a
single cell
GRASS GIS
trac at osgeo.org
Tue Jun 2 03:28:27 EDT 2009
#475: r.stats: last bin always has a single cell
-----------------------+----------------------------------------------------
Reporter: hamish | Owner: grass-dev at lists.osgeo.org
Type: defect | Status: new
Priority: critical | Milestone: 6.4.0
Component: Raster | Version: svn-develbranch6
Resolution: | Keywords: r.stats
Platform: All | Cpu: All
-----------------------+----------------------------------------------------
Comment (by hamish):
I've applied a fix for this bug in devbr6 r37699, and trunk r37700.
please review/test.
One thing I notice is that for multiple input maps of mixed types the
numbers for the * second map's ranges are a bit weird + change with the
patch.
e.g.:
{{{
#spearfish
# elevation.dem is CELL, elevation.10m is DCELL
g.region rast=elevation.10m
g.region n=n+10
# same before and after patch
G65> r.stats elevation.dem nsteps=5 -c | tail -n 11
100%
1831 108
1832 117
1833 108
1834 90
1835 72
1836 63
1837 36
1838 9
1839 27
1840 36
* 25848
}}}
{{{
# before patch
G65> r.stats elevation.10m nsteps=5 -c
100%
1061.064087-1218.199951 1090464
1218.199951-1375.335815 817890
1375.335815-1532.47168 573165
1532.47168-1689.607544 173282
1689.607544-1846.743408 1
G65> r.stats elevation.dem,elevation.10m nsteps=5 -c | tail -n 11
100%
1836 1532.47168-1689.607544 63
1837 1532.47168-1689.607544 35
1837 1689.607544-1846.743408 1
1838 1532.47168-1689.607544 9
1839 1532.47168-1689.607544 27
1840 1532.47168-1689.607544 36
* 1061.064087-1218.199951 10968
* 1218.199951-1375.335815 2496
* 1375.335815-1532.47168 10395
* 1532.47168-1689.607544 90
* * 1899
}}}
note 2x cat 1837 in above..(?) [they add up ok]
{{{
# after patch
G65> r.stats elevation.10m nsteps=5 -c
100%
1061.064087-1218.199951 847076
1218.199951-1375.335815 730296
1375.335815-1532.47168 565685
1532.47168-1689.607544 411802
1689.607544-1846.743408 99943
* 1899
G65> r.stats elevation.dem,elevation.10m nsteps=5 -c | tail -n 11
100%
1835 1689.607544-1846.743408 72
1836 1689.607544-1846.743408 63
1837 1689.607544-1846.743408 36
1838 1689.607544-1846.743408 9
1839 1689.607544-1846.743408 27
1840 1689.607544-1846.743408 36
* 1061.064087-1218.199951 10090
* 1218.199951-1375.335815 881
* 1375.335815-1532.47168 8634
* 1532.47168-1689.607544 4344
* * 1899
}}}
Hamish
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/475#comment:5>
GRASS GIS <http://grass.osgeo.org>
More information about the grass-dev
mailing list