<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p>Hi Nicolas:</p>
<p>I would use the SAGA Raster Statistics for polygons tool which
which you can access through the processing toolbox. <br>
</p>
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 2/12/2018 5:38 AM, Nikos Alexandris
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:20180212093841.fybqkrpcppatq62y@mail.nikosalexandris.net">*
Nicolas Cadieux <a class="moz-txt-link-rfc2396E" href="mailto:nicolas.cadieux@archeotec.ca"><nicolas.cadieux@archeotec.ca></a> [2018-02-11
23:37:13 -0500]:
<br>
<br>
<blockquote type="cite">Hi,
<br>
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?
<br>
<br>
Thanks,
<br>
Nicolas
<br>
</blockquote>
<br>
Nicolas,
<br>
<br>
not a direct answer, yet if you have access to GRASS' tools, then
you could look
<br>
into v.rast.stats.html [0] (or even r.stats.zonal [1] if you have
a
<br>
raster version of your "polygons").
<br>
<br>
If I understand correctly, you want to get statistics per polygon,
not
<br>
per class. I.e., min, max, sum and the rest, for each class inside
<br>
each vector polygon.
<br>
<br>
v.rast.stats will derive the statistics in question from a raster
map
<br>
for the parts covered by the vector map. Note, internally, the
vector map is
<br>
converted to a raster.
<br>
<br>
If you have two rasters, then your base map is the "multiple
classes map".
<br>
Your cover map will be the "rasterised vector polygons", which you
consider as
<br>
the zones to compute the statistics in question within. Very
useful,
<br>
here, is the `-r` flag: "Create reclass map with statistics as
category
<br>
labels".
<br>
<br>
Nikos
<br>
<br>
[0] <a class="moz-txt-link-freetext" href="https://grass.osgeo.org/grass74/manuals/v.rast.stats.html">https://grass.osgeo.org/grass74/manuals/v.rast.stats.html</a>
<br>
[1] <a class="moz-txt-link-freetext" href="https://grass.osgeo.org/grass74/manuals/r.stats.zonal.html">https://grass.osgeo.org/grass74/manuals/r.stats.zonal.html</a>
<br>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Qgis-user mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Qgis-user@lists.osgeo.org">Qgis-user@lists.osgeo.org</a>
List info: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a>
Unsubscribe: <a class="moz-txt-link-freetext" href="https://lists.osgeo.org/mailman/listinfo/qgis-user">https://lists.osgeo.org/mailman/listinfo/qgis-user</a></pre>
</blockquote>
<br>
<pre class="moz-signature" cols="72">--
Kirk Schmidt, MScF, BScF, RPF
General Manager
Nortek Resource Solutions Inc.
RR # 1
Thorburn, NS
B0K 1W0
Tel (902) 922.3607
Email: <a class="moz-txt-link-abbreviated" href="mailto:kirk@nortekresources.com">kirk@nortekresources.com</a>
Web: <a class="moz-txt-link-abbreviated" href="http://www.nortekreources.com">www.nortekreources.com</a></pre>
</body>
</html>