Marcelino & All--

If, by random, you mean either equal inclusion probability (of points or
transects) or even known/computable inclusion probability (e.g., for
Horvitz-Thompson estimators of properties of the entire polygon), be wary of
edges and think very carefully about what exactly you are generating these
transects for.  If you draw endpoints or midpoints and directions, you are
undersampling the area within a transect length of your polygon edges.  If
you are worried about computational time for generating your transects, that
implies that a large fraction of your "potential" transects will be near the
edges.

Either google "spatial sampling" and edge or inclusion or EPA, or if you
have access to Web of Science, start with Cox, D.  et al.  1997.  Spatial
sampling and the environment.  Environmental and Ecological Statistics
4(3):219-233.

tom

On Thu, Feb 12, 2009 at 12:42 PM, Barry Rowlingson <
b.rowlingson@lancaster.ac.uk> wrote:

> 2009/2/12 Marcelino de la Cruz <marcelino.delacruz@upm.es>:
> >
> > As an spatstat aficionado, I would use the following code:
>
>  Very very nice, but:
>
> > #compute a circle around each point
> > cosadisc<- apply(cosaxy,1, function(x) disc(r=ltransect, x))
>
>  generates 128 points on a circle around each point. There's a teeny
> tiny chance that none of those points will be in your polygon :)  What
> you've done is a rejection method where you generate 128 and throw 127
> away!
>
>  I can see the following ways of doing this:
>
>  A:  1. generate first point from CSR on the polygon
>      2. generate second point at distance D from first point
>      3. goto *2* until second point is in polygon.
>
>  B: 1. generate first point from CSR on the polygon
>     2. generate second point at distance D from the first point
>     3. goto *1* until second point is in polygon
>
>  C: buffer zone method
>
> your code essentially does A, where the first points are CSR but the
> second points arent (I think), and B will have neither first points
> nor second points as CSR since it avoids the edges.
>
> the buffer zone method produces CSR in the inner zone for the first
> points and non-CSR for the second points.
>
> all depends on what the original questioner wanted - if just a bunch
> of segments of length D roughly scattered around inside the polygon
> then wham! your lovely spatstat code is exactly that!
>
> Barry
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo@stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>

	[[alternative HTML version deleted]]

