[prev in list] [next in list] [prev in thread] [next in thread] 

List:       r-sig-geo
Subject:    Re: [R-sig-Geo] Sampling point density increasing with distance
From:       Rolf Turner <r.turner () auckland ! ac ! nz>
Date:       2011-10-25 21:09:36
Message-ID: 4EA72590.30001 () auckland ! ac ! nz
[Download RAW message or body]

On 26/10/11 02:48, Arnaud Mosnier wrote:
> Dear Geo Users,
>
> I am trying to create "random" points which density decrease with the
> distance from a polygon or a line.
> Is there an function in R that can allow me to do that ?

A combination of functions from the "spatstat" package will
readily allow you to do that.  You will need to form an "im"
object say ``A'', of the distances from the your ``polygon or line'', using
the distmap() function.  You can then generate an inhomogeneous
Poisson process whose intensity is a (decreasing) function of A using the
rpoispp() function.   To calculate the decreasing function of A you would
do something like

     B <- eval.im(1/A)
or
     B <- eval.im(exp(-A))

and then do

     X <- rpoispp(B)

HTH

     cheers,

             Rolf Turner

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic