* Nicolas Cadieux <nicolas.cadi...@archeotec.ca> [2018-02-11 23:37:13 -0500]:

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?



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


[0] https://grass.osgeo.org/grass74/manuals/v.rast.stats.html
[1] https://grass.osgeo.org/grass74/manuals/r.stats.zonal.html

Attachment: signature.asc
Description: PGP signature

Qgis-user mailing list
List info: https://lists.osgeo.org/mailman/listinfo/qgis-user
Unsubscribe: https://lists.osgeo.org/mailman/listinfo/qgis-user

Reply via email to