[GRASS-dev] [GRASS GIS] #3300: v.rast.stats: wrong results for non-first category values in the case of multiple category values per feature

GRASS GIS trac at osgeo.org
Mon Feb 27 04:41:43 PST 2017


#3300: v.rast.stats: wrong results for non-first category values in the case of
multiple category values per feature
--------------------------+----------------------------------
  Reporter:  mlennert     |      Owner:  grass-dev@…
      Type:  defect       |     Status:  new
  Priority:  normal       |  Milestone:  7.2.1
 Component:  Vector       |    Version:  unspecified
Resolution:               |   Keywords:  v.rast.stats overlap
       CPU:  Unspecified  |   Platform:  Unspecified
--------------------------+----------------------------------

Comment (by mlennert):

 The issue obviously comes from the internal use of v.to.rast to transform
 the vector polygon map to a raster map which then can be used as zonal map
 input to r.univar. v.to.rast uses the first category value of the polygons
 as pixel value for the output raster map.

 A possible path towards a solution to this problem might be to check
 whether polygons with multiple categories exist, and if that is the case,
 to create a new layer in the polygon file with a unique cat value for each
 polygon. Then run v.to.rast on that layer and r.univar. Load the results
 of r.univar as a table linked to the new layer with unique cat value, and
 then use some SQL magic / v.to.db to create an association table between
 the cat values in the original layer of the polygon map and the cat values
 in the new layer be able to calculate aggregate values for each cat in the
 original layer.

 Just ideas, but no time to work on that at this stage...

--
Ticket URL: <https://trac.osgeo.org/grass/ticket/3300#comment:1>
GRASS GIS <https://grass.osgeo.org>



More information about the grass-dev mailing list