[GRASS-dev] module for collecting percentages of raster classes in a vector map
Helmut Kudrnovsky
hellik at web.de
Mon Jul 2 13:56:00 PDT 2018
Hi Moritz,
Moritz Lennert wrote
> Hi everyone,
>
> I have a vague memory that someone has coded this before, but cannot
> find it anywhere, but before I code it myself I wanted to know if my
> vague memory actually was right: I need a module that takes a
> qualitative raster map (e.g. land cover map) and a vector polygon map
> and calculates the share of each raster class in each vector polygon.
> This just means looping of the raster categories, create a reclass map
> for each category (category = 1 and rest=null) and then use r.univar to
> calculate non_null_cells/(non_null_cells+null_cells), so it's fairly
> easy to code, but even so, does anyone know if something like this
> already exists, before I reinvent the wheel ?
maybe related, in the addon v.habitat.dem I calculate e.g.
geomorphons: absolute area of flat, summit, ridge, shoulder, spur, slope,
hollow, footslope, valley, depression per polygon
it's around [1]
[1]
https://trac.osgeo.org/grass/browser/grass-addons/grass7/vector/v.habitat.dem/v.habitat.dem.py#L412
-----
best regards
Helmut
--
Sent from: http://osgeo-org.1560.x6.nabble.com/Grass-Dev-f3991897.html
More information about the grass-dev
mailing list