I solved the error problem (yes, it's topologically not correct...) looking
for the intersection between the buffer and each polygon in comuniUTM (one
by one):
nComuni=length(comuniUTM$ISTAT_NUM)
for (pol in 1:nComuni)
{
BFp=comuniUTM[pol,]
I=gIntersects(b,BFp)
if (I==TRUE)
From your initial question I suspect that what you want to do is
I <- gIntersects(b, comuniUTM, byID=TRUE)
Though this will probably rise the same error, which I suspect comes from the fact, that the
polygons in comuniUTM are topologically not correct. You might want to clean them e.g. in GRASS
Thank you,
I tried the following code:
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 spa
Hi Luca,
have a look at the functions in package rgeos.
regards,
Tom
Am 07.09.2011 13:12, schrieb luca candeloro:
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 trie
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=WGS8