[Qgis-user] Zonal Statistics multiple classe
Nikos Alexandris
nik at nikosalexandris.net
Mon Feb 12 01:38:42 PST 2018
* Nicolas Cadieux <nicolas.cadieux at archeotec.ca> [2018-02-11 23:37:13 -0500]:
>Hi,
>I have a raster (int16) with multiple class (ex 1 = grass, 2 =
>trees...) and a vector polygon file. I want to have the zonal
>statistic (cum, min, max, sum...) for every class. What is the best
>way to get this done in QGis 2.18.16 on Windows 10?
>
>Thanks,
>Nicolas
Nicolas,
not a direct answer, yet if you have access to GRASS' tools, then you could look
into v.rast.stats.html [0] (or even r.stats.zonal [1] if you have a
raster version of your "polygons").
If I understand correctly, you want to get statistics per polygon, not
per class. I.e., min, max, sum and the rest, for each class inside
each vector polygon.
v.rast.stats will derive the statistics in question from a raster map
for the parts covered by the vector map. Note, internally, the vector map is
converted to a raster.
If you have two rasters, then your base map is the "multiple classes map".
Your cover map will be the "rasterised vector polygons", which you consider as
the zones to compute the statistics in question within. Very useful,
here, is the `-r` flag: "Create reclass map with statistics as category
labels".
Nikos
[0] https://grass.osgeo.org/grass74/manuals/v.rast.stats.html
[1] https://grass.osgeo.org/grass74/manuals/r.stats.zonal.html
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 228 bytes
Desc: not available
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20180212/423737fd/attachment.sig>
More information about the Qgis-user
mailing list