[GRASS-dev] [GRASS GIS] #3184: v.ect.stats: errors in counts and statistics

GRASS GIS trac at osgeo.org
Mon Oct 17 11:29:39 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
 Keywords:  v.vect.stats  |        CPU:  x86-64
 Platform:  Linux         |
--------------------------+-------------------------
 I am working with cases of a disease in Greece. So, I have points
 (coordinates) and I need to get a count of those cases per municipality
 and higher administrative units, i.e: NUTS. However, v.vect.stats gives
 wrong counts. In, my case, I should have 615 cases and if I sum the cases
 counted by v.vect.stats (using v.db.select mymap column=cases), I get 767.
 In some polygons, it counts ok, in some it misses points, in others it
 "invents" extra points.

 I guess the whole problem is maybe related to the fact that Greece has so
 many islands split in a much lower number of categories (i.e.: belonging
 to a reduced number of administrative units), but I don't know.

 Anyway, I attach a vector of polygons and a vector of points as an
 example. They were created in NC demo location. Just unpack and run:

 {{{
 v.vect.stats -p points=points_test areas=areas_test method=average
 points_column=value count_column=count stats_column=average
 }}}

 This is the output:

 {{{
 area_cat|count|average
 1|3|5.5
 2|0|null
 3|6|11.3333333333333
 3|0|null
 6|2|10.5
 }}}

 Printing to stout gives two lines for cat 3, one with the right count, one
 with 0. However, G7:v.db.select gives a different output:

 {{{
 v.db.select areas_test
 cat|count|average
 1|3|5.5
 2|0|
 3|0|
 6|2|10.5
 }}}

 If you query the map from the GUI or display the attribute table, polygons
 with cat 3 have 0 count (see attached screenshot).

 Not only the count is wrong, but the average seems also weird. The three
 points in the polygons with cat 1 have a value of 5, why would average be
 5.5?

 I'm running GRASS trunk r69699 under Fedora 24.

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3184>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list