[Qgis-user] Extract raster cell-value statistics (min, max, count, sum) within a polygone

Michael Treglia mtreglia at gmail.com
Mon Apr 20 08:02:31 PDT 2015


Hi Johan.

I've re-added the QGIS-User list to this, as I'm primarily on Windows. Just
upgraded to QGIS 2.8.1 no a virtual machine with ubuntu 14.04, and also
didn't get SAGA or GRASS installed immediately, and don't have time right
now to figure it out.  (I imagine others on the list can help you with the
saga/grass install issues)

As a quick work-around, you should be able to just install SAGA via the
tarball here:
http://sourceforge.net/projects/saga-gis/files/SAGA%20-%202.1/SAGA%202.1.4/
[or just sudo apt-get install saga seems to work too].  At least on
windows, you can just drag files into SAGA and work with them there, and
then work with the respective modules, so hopefully that is the same on
Ubuntu.

An alternative is working with R, using the 'extract' function in the
'raster' package (see the documentation here:
http://cran.r-project.org/web/packages/raster/index.html; and a good intro
to spatial data with R is available here:
http://science.nature.nps.gov/im/datamgmt/statistics/r/advanced/spatial.cfm)

Sorry I can't be more help - good luck.
Cheers,
Mike

On Mon, Apr 20, 2015 at 9:12 AM, Johan Nilsson <joni8135 at gmail.com> wrote:

> Can't find Saga or Grass tools on Ubuntu 14.04 with
> http://ppa.launchpad.net/ubuntugis/ubuntugis-unstable/ubuntu
>
> Maybe down grade to stable? For a couple of years ago unstable was stable,
> but now with Grass 7.0 and i don't know how it is with SAGA, but I can not
> find it. Maybe It is why Processing --> Zonal Statistics do not work
> because it depend on Grass 6.4 or Saga? When i run processing --> zonal
> statistics noting happens but say I shoukld check the log, but the
> log-window does not show anything.
>
> 2015-04-20 2:23 GMT+02:00 Michael Treglia <mtreglia at gmail.com>:
>
>> Also, theres a utility in SAGA, implemented within the Processing
>> toolbox. See SAGA -> Shapes - Grid -> Grid statistics for polygons
>>
>> Lets you calculate:
>> * Number of Cells
>> * Minimum
>> * Maximum
>> * Range
>> * Sum
>> * Mean
>> * Variance
>> * Standard Deviation
>> * Specified Quartiles
>>
>> Hope that helps,
>> mike
>>
>> On Sun, Apr 19, 2015 at 11:54 AM, Micha Silver <micha at arava.co.il> wrote:
>>
>>>
>>>
>>> On 04/19/2015 12:34 PM, Johan Nilsson wrote:
>>>
>>>  Zonal statistics work well to extract, numers of cells(counts) , sum
>>> of the value (sum)  and also average (mean) But I want the minimum AND
>>> max-value and also standard error, if possible. Is there another plugin or
>>> a tutorial how it may bee done in another way.
>>>
>>>   The GRASS module v.rast.stats does what you want. But it's not in the
>>> Processing toolbox. You can import your raster into a GRASS mapset then do
>>> the analysis directly within GRASS.
>>>
>>>  The code to Zonal statistics are here, but I'm total lost in how it
>>> work.
>>>
>>>
>>> https://github.com/qgis/QGIS/blob/a2f51260db5357917e86b78f1bb2915379d670dd/src/analysis/vector/qgszonalstatistics.cpp
>>>
>>>  /Cheers
>>>
>>> This mail was received via Mail-SeCure System.
>>>
>>>
>>> _______________________________________________
>>> Qgis-user mailing listQgis-user at lists.osgeo.orghttp://lists.osgeo.org/mailman/listinfo/qgis-user
>>> This mail was received via Mail-SeCure System.
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> Qgis-user mailing list
>>> Qgis-user at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/qgis-user
>>>
>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-user/attachments/20150420/d2dcbe47/attachment.html>


More information about the Qgis-user mailing list