[GRASSLIST:7862] Re: Generating rasters at different resolutions

Zaboj Hrazsky, DAPHNE CR zaboj.hrazsky at daphne.cz
Thu Aug 11 10:08:22 EDT 2005


Jose Gomez-Dans napsal(a):
> Hi!
> I have generated rasters from vectors at a very fine resolution
> (related to the accuracy of the vector data), and I want to aggregate
> these cells to generate rasters at a much coarser resolution. For each
> cell in the aggregated raster, the value should be the value that is
> majoritary on the high resolution raster, provided it also exceeds an
> area threshold. Additionally, it would be nice to have a second raster
> with the percentage of area of the chosen category.
> 
> In principle, I had thought about using r.mapcalc, but I haven't
> sussed out how to select the neighborhood to be considered. There's
> the ewres and the nsres operators, but I don't think I understand how
> to use them, or how to carry out what I want to do!
> 
> Any pointers appreciated,
> Jose
> 
> 
I found the solution on:

http://grass.gdf-hannover.de/twiki/bin/view/GRASS/AggregateValues

and was repeat in GRASS list on http://grass.itc.it/pipermail/grassuser/2005-July/029727.html

Next try to find the answer before U ask the forum at: http://grass.itc.it/searchgrass.php for this only "aggregate" topic has hit the right answer...

shortly the aggregation process in GRASS:

g.region res=REQUIRED_RESOLUTION
r.random.cells out=BASE dist=0
g.region res=ORIGINAL_RESOLUTION
r.statistics base=BASE cover=ORIG_RASTER method=sum out=AGGREG_RASTER

aggregated values are stored as labels (accesible as @AGGREG_RASTER in r.mapcalc modul), for final raster run:

g.region res=REQUIRED_RESOLUTION
r.mapcalc FINAL_AGGREG_RASTER=@AGGREG_RASTER 

-- 
    Záboj Hrázský
   ___________________________________________
   
    DAPHNE ČR - Institut aplikované ekologie
    Husova 45, 370 05 České Budějovice
    http://www.daphne.cz
    Tel: +420 776053573
    ICQ: 332817882
   ___________________________________________

   




More information about the grass-user mailing list