[Qgis-user] averaging raster grid

Micha Silver micha at arava.co.il
Wed Apr 14 03:27:33 PDT 2010


On 14/04/2010 13:25, M.E.Dodd wrote:
> Yep just after emailing I got it into grass and am now fighting with the v.rast.stats command which at the moment is not accepting the layers I want to use with it, will look at the manual.  Thanks for your help as I had not got into the GRASS link in qgis before as each time I had tried it previously it broke.
>    
Be sure you have created the GRASS Location correctly (choose the same 
Coordinate System as your original data). It's easy when using the QGIS 
wizard.

> -----Original Message-----
> From: Micha Silver [mailto:micha at arava.co.il]
> Sent: 14 April 2010 11:22
> To: M.E.Dodd
> Cc: Qgis-user at lists.osgeo.org
> Subject: Re: [Qgis-user] averaging raster grid
>
> On 14/04/2010 13:06, M.E.Dodd wrote:
>    
>> I've uninstalled qgis and reinstalled it using the OSGeo4W installer and got GRASS too.  However when I come to use the GRASS plugin I can't see how to get to v.rast.stats infact it does not really want to know since the maps are in qgis not as GRASS maps.
>>
>>
>>      
> Yes, GRASS uses its own internal data format. So you need to import the
> raster and vector into GRASS with the commands:
> v.in.ogr dsn=<path to shapefile>  out=vect_grid
> r.in.gdal<path to raster>  out=rast_name
>
> Then try v.rast.stats
>
> I recommend the QGIS user's manual to better understand these procedures.
> http://download.osgeo.org/qgis/doc/manual/qgis-1.4.0_user_guide_en.pdf
> especially the chapter on GRASS
>
>    
>> -----Original Message-----
>> From: Micha Silver [mailto:micha at arava.co.il]
>> Sent: 13 April 2010 18:18
>> To: M.E.Dodd
>> Subject: Re: [Qgis-user] averaging raster grid
>>
>>
>> M.E.Dodd wrote:
>>
>>
>>      
>>> Thanks for both replies. Will try to send new fresh messages in future, I did not know about the issue you mention.
>>>
>>> I don't have the GRASS plugin, do you need to have GRASS installed as well as qgis to use this (I don't have GRASS installed). From what you say then this is just what I want v.rast.stats
>>>
>>>
>>>
>>>        
>> What operating system? How did you install?
>> On windows, if you used the OSGeo4W installer (recommended) then you can
>> rerun the installer, choose the "Advanced" installation method, then
>> check to install GRASS. (Also choose the "unstable" QGIS version 1.4
>> There's also a ready made Windows package with GRASS here:
>> http://kcubeconsulting.com/download.php
>>
>> On Ubuntu there are ready made packages in the UbuntuGIS repository.
>>
>>
>>      
>>> One other issue on the plugins, today when I have been using qgis the list of possible plugins is rather shorter than normal as if something strange has happened to it, all the normal plugins I use and are installed are there but the longer list of ones that are not installed all seem to have vanished (I often browse this list to see if there is anything that might be useful but they have gone).
>>>
>>>
>>>        
>> Don't know about that. Did you click the "Fetch Python plugins"? and did
>> it go to the internet to refresh the list of available plugins?
>>
>>
>>      
>>> -----Original Message-----
>>> From: Micha Silver [mailto:micha at arava.co.il]
>>> Sent: 13 April 2010 15:46
>>> To: M.E.Dodd
>>> Subject: Re: [Qgis-user] averaging raster grid
>>>
>>> On 13/04/2010 16:58, M.E.Dodd wrote:
>>>
>>>
>>>        
>>>> I have a raster digital elevation model and want to overlay a coarser grid vector layer and average the very detailed raster to give the average values in each of the grid squares specified by the vector grid, is this possible?  The existing vector and raster tools hint at doing some of it but I can't work out how to do exactly this.
>>>>
>>>>
>>>>
>>>>
>>>>          
>>> Hi Mike:
>>> You might not be aware the mail list keeps messages "threaded", so if
>>> you reply to a message, but change the subject, your new message still
>>> gets stuck into the ongoing thread of the original, making things hard
>>> to follow. If you have a new subject, send a new message, not a reply.
>>>
>>> As to your question:
>>> I gather that your vector "grid" is a polygon layer of rectangles? Using
>>> the GRASS plugin you can run the module called v.rast.stats. This module
>>> calculates univariate statistics from a raster layer for each polygon in
>>> a vector layer, and adds the stats to new columns in the vectors
>>> attribute table.
>>> Does that help?
>>> Regards,
>>> Micha
>>>
>>>
>>>
>>>        
>>>> Mike
>>>>
>>>>
>>>>
>>>>
>>>>          
>>>
>>>
>>>        
>>
>>      
>
>    


-- 
Micha Silver
http://www.surfaces.co.il/
Arava Development Co.  +972-52-3665918




More information about the Qgis-user mailing list