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 spatial polygon whit the buffer of 4 km around the point using
function gbuffer from rgeos library (better than before)
b=gBuffer(puntoUTM,width=4000,quadsegs=50)

#Try to get intersection but an error occurs
I=gIntersection(b,comuniUTM

Errore in RGEOSBinTopoFunc(spgeom1, spgeom2, byid, id, "rgeos_intersection")
:
  TopologyException: found non-noded intersection between LINESTRING (759692
4.85308e+006, 759729 4.85308e+006) and LINESTRING (759729 4.85308e+006,
759692 4.85308e+006) at 759723 4.85308e+006

Do you konw about this error?
Bye,
Luca.



2011/9/7 Tom Gottfried <tom.gottfried@tum.de>

> 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 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<https://stat.ethz.ch/mailman/listinfo/r-sig-geo>
>>
>
> --
> Technische Universität München
> Department für Pflanzenwissenschaften
> Lehrstuhl für Grünlandlehre
> Alte Akademie 12
> 85350 Freising / Germany
> Phone: ++49 (0)8161 715324
> Fax:   ++49 (0)8161 713243
> email: tom.gottfried@wzw.tum.de
> http://www.wzw.tum.de/**gruenland <http://www.wzw.tum.de/gruenland>
>
> ______________________________**_________________
> R-sig-Geo mailing list
> R-sig-Geo@r-project.org
> https://stat.ethz.ch/mailman/**listinfo/r-sig-geo<https://stat.ethz.ch/mailman/listinfo/r-sig-geo>
>

	[[alternative HTML version deleted]]

