An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20100215/c1c95540/attachment.pl>
compute buffer from point shapefile to have shapefile
2 messages · gianni lavaredo, Robert J. Hijmans
Gianni,
Here is an example for longitude/latitude data using (together with
the more usual suspects) the geosphere package (recently released to
CRAN).
xy <- cbind(0, seq(-80, 80, by=20))
dist = 1000000 # 500 km
angles = seq(1,360, by=5)
library(geosphere)
crds = list()
for (i in 1:nrow(xy)) {
d = destPoint(xy[i,], angles, dist)
crds[[i]] = rbind(d, d[1,])
}
library(sp)
p = lapply(crds, Polygon)
pp = list()
for (i in 1:length(p)) pp[i] = Polygons(p[i], i)
spdf = SpatialPolygonsDataFrame(SpatialPolygons(pp), data.frame(id=1:length(p)))
library(maptools)
data(wrld_simpl)
plot(wrld_simpl)
plot(spdf, add=TRUE, border='red', lwd=2)
points(xy, pch=20, col='blue')
On Mon, Feb 15, 2010 at 5:39 AM, gianni lavaredo
<gianni.lavaredo at gmail.com> wrote:
Dear Researchers,
I am looking for a library to compute buffer (Ex: 10 m radius) around a
shapefile point file. I find buffer {adehabitat} but I wish to know if there
is another library to compute buffer.
Thanks for helps
gianni
? ? ? ?[[alternative HTML version deleted]]
_______________________________________________ R-sig-Geo mailing list R-sig-Geo at stat.math.ethz.ch https://stat.ethz.ch/mailman/listinfo/r-sig-geo