* Nikos Alexandris <n...@nikosalexandris.net> [2018-02-12 10:38:42 +0100]:

* Nicolas Cadieux <nicolas.cadi...@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".


Yet, I have to correct myself here. It's the other way around. The cover map is the source of numbers to compute the statistics.
Thus, here it will be the "multiple classes map".

The base map will be the "polygons" map.

Nikos


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



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


--
Nikos Alexandris | Remote Sensing & Geomatics
GPG Key Fingerprint 6F9D4506F3CA28380974D31A9053534B693C4FB3

Attachment: signature.asc
Description: PGP signature

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

Reply via email to