[GRASS-dev] [GRASS GIS] #3184: v.ect.stats: errors in counts and statistics
GRASS GIS
trac at osgeo.org
Wed Oct 19 10:02:36 PDT 2016
#3184: v.ect.stats: errors in counts and statistics
-------------------------+--------------------------
Reporter: veroandreo | Owner: grass-dev@…
Type: defect | Status: new
Priority: normal | Milestone: 7.2.0
Component: Vector | Version: svn-trunk
Resolution: | Keywords: v.vect.stats
CPU: x86-64 | Platform: Linux
-------------------------+--------------------------
Comment (by mlennert):
Here's another example with internally generated data:
{{{
g.region res=1 n=3 s=0 w=0 e=3 -p
v.mkgrid grid=3,3 map=grid
v.extract grid type=centroid out=gc
v.category grid type=centroid out=grid_no_cats cat=-1 op=del
g.copy vect=grid_no_cats,grid_one_cat
v.edit grid_one_cat type=centroid tool=catadd cat=1 bbox=0,0,3,3
v.vect.stats -p points=gc type=centroid areas=grid points_col=col
countcol=count statscol=sum method=sum
Selecting points for each area...
100%
area_cat|count|sum
1|1|1
2|1|2
3|1|3
4|1|1
5|1|2
6|1|3
7|1|1
8|1|2
9|1|3
v.vect.stats -p points=gc type=centroid areas=grid_one_cat points_col=col
countcol=count statscol=sum method=sum
Selecting points for each area...
100%
area_cat|count|sum
1|0|null
1|0|null
1|9|18
1|0|null
1|0|null
}}}
IOW, with all grid cells having the same cat value, results become
nonsense except for one case. However, this one case is not the one
uploaded to the vector attribute table when one doesn't use the '-p' flag.
--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3184#comment:1>
GRASS GIS <https://grass.osgeo.org>
More information about the grass-dev
mailing list