Hello,
I'd like to select, given a SpatialPolygonDataframe and a point (of known
coordinates), which are the polygons into the buffer (of a given distance)
around the point.
I tried the following code, but I don't know how to end it...

UTM32WGS84 <- CRS("+proj=utm +zone=32 +ellps=WGS84 +datum=WGS84 +no_defs")
comuniUTM=spTransform(comuni, UTM32WGS84) #where comuni is a
SpatialPolygonDataFrame
puntoUTM<- spTransform(punto, UTM32WGS84) #where punto is a
SpatialPointDataFrame
#I create the spatial polygon whit the buffer of 4 km around the point using
function disc() and converting it into a SpatialPolygons...
discbuff<-disc(radius=4000, centre=puntoUTM@coords[,])
discpoly<-Polygon(rbind(cbind(discbuff$bdry[[1]]$x,
y=discbuff$bdry[[1]]$y), c(discbuff$bdry[[1]]$x[1],
y=discbuff$bdry[[1]]$y[1])))
discpoly=list(discpoly)
discbuff<-Polygons(list(discpoly[[1]]), ID=1)
discbuffSP=SpatialPolygons(list(discbuff))
proj4string(discbuffSP)=UTM32WGS84

#Does anyone konw how can I get the polygons in comuniUTM intersecting the
discbuffSP?

Thanks a lot,
Luca.

        [[alternative HTML version deleted]]

_______________________________________________
R-sig-Geo mailing list
R-sig-Geo@r-project.org
https://stat.ethz.ch/mailman/listinfo/r-sig-geo

Reply via email to