[Qgis-user] averaging raster grid
Micha Silver
micha at arava.co.il
Wed Apr 14 12:44:45 PDT 2010
M.E.Dodd wrote:
> Am still trying this. Seems I might be nearly there but for some reason can't create a grass vector layer so can't use the v.rast.stats command.
> I have created the grass raster layers from the raster layers that are open in qgis and they seem fine but when I try to create the grass vector layer it says its worked but then won't visualise it. to summarise this part I have an open vector layer in qgis, also saved as a shapefile, when I run the command to convert this layer to a grass vector layer there are not errors but it won't visualise when the command completes and I can't add it as a new grass layer even though it says it recognises the filename.
>
>
Hi Mike:
(I'm assuming that the vector and raster are projected in the same CRS,
and they overlap.)
Can you open the GRASS toolbox and switch to the Browser tab. Then open
the vector section, and click on this imported vector. On the right you
should see a table similar to below.
Please either post a screen shot on the web somewhere, or you can
copy/paste the text into a mail message. Send this to the qgis-user
maillist and we can try to understand what is wrong.
While you're at it, grab the same table of info for the raster, and post
that as well...
Vector
veg
Points
0
Lines
0
Boundaries
5732
Centroids
835
Areas
4293
Islands
3516
North
55:51:56.766357N
South
39:35:35.604858N
East
30E
West
12:35:51.329041E
3D
no
History
COMMAND: v.in.ogr -o
dsn="/home/micha/geodata/Training/Geodata/vector/VMAP0/veg_cropland.shp"
output="veg" min_area=0.0001 snap=-1
GISDBASE: /home/micha/geodata/grass
LOCATION: WGS84 MAPSET: PERMANENT USER: micha DATE: Wed Apr 14 22:21:18 2010
------------------------------------------------------------------------
802 input polygonsTotal area: 1.053955e+12 (4293 areas)Overlapping area:
7.020819e+09 (53 areas)Area without category: 1.341091e+11 (3458 areas)
--
Micha
> Am wondering if this is some kind of bug since the structure of ht eprogram seems to be just the same for the raster and vector but the raster works but the vector does not.
>
> -----Original Message-----
> From: Micha Silver [mailto:micha at arava.co.il]
> Sent: 14 April 2010 11:28
> To: M.E.Dodd
> Cc: Qgis-user at lists.osgeo.org
> Subject: Re: [Qgis-user] averaging raster grid
>
> 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
Arava Development Co. +972-52-3665918
http://www.surfaces.co.il
More information about the Qgis-user
mailing list