#3184: v.vect.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): Replying to [comment:4 veroandreo]: > I applied the patch and tested. > - For my data (615 points, 3600 areas split in 325 categories), I got Segmentation fault. Yes, i just noticed this for the original test data (test_areas, test_points) as well... > - For the data generated with the commands you just posted, the result looks fine when running v.vect.stats with -p flag. > > {{{ > GRASS 7.3.svn (nc_spm_08_grass7):~ > 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|9|18 > }}} > > However, if you remove that flag, to actually update the attribute table (which for this case it is supposed to have only one category), I get: > > {{{ > GRASS 7.3.svn (nc_spm_08_grass7):~ > v.db.select grid_one_cat > cat|row|col|rown|coln|count|sum > 1|3|1|C|A|9|18 > 2|3|2|C|B|| > 3|3|3|C|C|| > 4|2|1|B|A|| > 5|2|2|B|B|| > 6|2|3|B|C|| > 7|1|1|A|A|| > 8|1|2|A|B|| > 9|1|3|A|C|| > }}} > > Is there something wrong with v.db.select or with v.edit? I followed all your steps. But even if I do {{{v.db.select grid_one_cat}}} before v.vect.stats (and after the v.edit step), I get all the old categories: > > {{{ > GRASS 7.3.svn (nc_spm_08_grass7):~ > v.db.select grid_one_cat > cat|row|col|rown|coln > 1|3|1|C|A > 2|3|2|C|B > 3|3|3|C|C > 4|2|1|B|A > 5|2|2|B|B > 6|2|3|B|C > 7|1|1|A|A > 8|1|2|A|B > 9|1|3|A|C > }}} > > I'm lost... This is normal: the table is not changed by the v.category commands, only the cat values. So all the old entries are still there. To make it really clean, one would have to run v.db.connect -d, db.droptable, v.db.addtable after the v.category command. -- Ticket URL: <https://trac.osgeo.org/grass/ticket/3184#comment:5> GRASS GIS <https://grass.osgeo.org> _______________________________________________ grass-dev mailing list grass-dev@lists.osgeo.org http://lists.osgeo.org/mailman/listinfo/grass-dev