[R-sig-Geo] Shapefile - GRID operations

Rainer M Krug r.m.krug at gmail.com
Mon Sep 8 16:42:02 CEST 2008


On Mon, Sep 8, 2008 at 12:30 PM, Jean-Paul Kibambe Lubamba
<jean-paul.kibambe at uclouvain.be> wrote:
> Hello everybody,
>
> I have one GRID with my weights values over my study area. I have also an
> Administrative boundaries shapefile of my study area with an unique value
> of my variable of interest for each administrative unit.
>
> I want to distribute my unique value by administrative unit for each pixel
> of my GRID taking into account the weights of each pixel.
>
> So I want to do the following steps :
>
> 1. select an Administrative unit (value of interest = Vi)
> 2. clip the GRID at the boundaries of that admin unit
> 3. calculate the sum of the weights for that clipped grid (= Wi)
> 4. clipped grid * Vi / Wi
> ... the same for all my administrative units.
>
> 5. at the end, have a new GRID of my study area with the value of my
> variable of interest distributed over all my administrative units.

Look into the function overlay() in the package sp. This will do what you need.

Rainer


>
>
> So for sure (I mean), there is a more efficient way to do it with R...
> Anyone could help me ?
>
> Thanks in advance !
>
>
> JP
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



-- 
Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation
Biology, UCT), Dipl. Phys. (Germany)

Centre of Excellence for Invasion Biology
Faculty of Science
Natural Sciences Building
Private Bag X1
University of Stellenbosch
Matieland 7602
South Africa




More information about the R-sig-Geo mailing list