[R-sig-Geo] majority filter for grids

Paul Hiemstra p.hiemstra at geo.uu.nl
Mon Aug 31 16:26:59 CEST 2009


Hi,

A while back I posted the code for a lowpass filter to the mailing list

http://markmail.org/message/y2vz42c3zbs2llrl#query:r-sig-geo%20smoothing+page:1+mid:fqt6wbgojnawmfnb+state:results

This code could probably be adapted to suit your needs.

cheers and hope this helps,
Paul

Häring, Tim (LWF) wrote:
> Dear List,
>
> I have a grid as SpatialGridDataFrame with a classified (nominal) attribute and I want to filter this grid in R with a majority filter. I searched the mailing list archive and googled around but I think I´m on the wrong track. 
> There are several filters for numeric attributes (mean, median, min, max, gaussian ...) but I didn`t find a way to filter a nominal attribute. I think there has to be a way to do this in R, because it is a day-to-day task in remote sensing.
>
> Is there anybody in the R-Sig-Geo world who solved this problem?
> I would be glad to have your explanation.
>
> Thanks a lot.
>
> Cheers,
> TIM
>
> ---------------------------------------------- 
> Tim Häring
> Bavarian State Institute of Forest Research 
> Department of Forest Ecology
> Am Hochanger 11
> D-85354 Freising
>
> http://www.lwf.bayern.de
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>   


-- 
Drs. Paul Hiemstra
Department of Physical Geography
Faculty of Geosciences
University of Utrecht
Heidelberglaan 2
P.O. Box 80.115
3508 TC Utrecht
Phone:  +3130 274 3113 Mon-Tue
Phone:  +3130 253 5773 Wed-Fri
http://intamap.geo.uu.nl/~paul



More information about the R-sig-Geo mailing list