[R-sig-Geo] Sampling within distance X from polyline(s)

David Holstius david.holstius at berkeley.edu
Mon Sep 20 04:54:37 CEST 2010

Dear all,

What is a good way to spatially sample N points of distance less than
X from a given polyline?

I'm thinking I should construct a polygonal buffer, and then sample
within that, e.g., with spsample(). But how can I construct such a
buffer in R? Can the method be extended to multiple polylines (as in a
SpatialLines object)?

I haven't found anything in the 'spatstat' or 'sp' packages about
using polyline(s) as the basis for sampling, other than for sampling
*on* the polyline(s).

Many thanks for any & all assistance. Many many thanks for for an
example with 'meuse'!

Very best,

David Holstius
PhD Student in Environmental Health Sciences
UC Berkeley School of Public Health

More information about the R-sig-Geo mailing list