[GRASS-user] Aggregate a classification map according to a vector
file
Pedro Roma
pedroroma1982 at gmail.com
Mon Jan 18 08:17:59 EST 2010
Thank you all. I thing I have managed to do this using r.statistics firstly
converting county polygons to Raster.
THank you guys
By the way, is there any special requirement, besides being a CELL, for base
data?
Thanks
On Mon, Jan 18, 2010 at 12:52 PM, Markus Metz <
markus.metz.giswork at googlemail.com> wrote:
>
>
> Pedro Roma wrote:
>
>> Greetings all
>>
>> As far as I can see, r.statistics (
>> http://grass.itc.it/grass64/manuals/html64_user/r.statistics.html) uses
>> as cover and as basis a RASTER map. But, "All cells in the base layer are
>> considered one object for the analysis". This is not what I want because I
>> want base layer to be a polygon not a cell. Or Am I reading this wrong?
>>
> You're right, but you can easily convert vector to raster. In this case,
> first set the region to match your cover map, then something like
> v.to.rast type=area
> then r.statistics
>
> v.what.rast also converts the vector to a raster first, then runs
> statistics. v.what.rast would be the best solution unless you want the most
> frequent category.
>
> Markus M
>
>
>
>> On Sat, Jan 16, 2010 at 9:59 AM, Markus Metz <
>> markus.metz.giswork at googlemail.com <mailto:
>> markus.metz.giswork at googlemail.com>> wrote:
>>
>>
>> Markus Neteler wrote:
>>
>> Pedro Roma wrote:
>>
>> Greetings all
>> A few emails that people sent, regarding classigication
>> operations GRASS
>> were extremely helpful :)
>> But now, I have one question:
>> I need to do some aggregation of the classification map
>> according to regions
>> specified in a vector file. What I mean is, for each
>> county I need to have
>> an aggregation of all classified pixels in order to have
>> only one value that
>> represents that county.
>> E.g. I have a land cover classification for my region and
>> now I need to
>> aggregate the classified map according to my counties in
>> order to have a
>> vector map in which each county is represented by its more
>> frequent
>> classification.
>> Is this possible in GRASS? Was I clear :D ?
>>
>>
>> Could this be of interest?
>> Addons: r.univar.zonal
>>
>> http://svn.osgeo.org/grass/grass-addons/raster/r.univar2.zonal/r.univar.zonal.html
>>
>> Or r.statistics with method=mode, gives you the most frequent
>> value in cover map for each value in base map. AFAIK,
>> r.univar[.zonal] doesn't have modal as output.
>>
>> Markus M
>>
>>
>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/grass-user/attachments/20100118/878d3b09/attachment-0001.html
More information about the grass-user
mailing list