I am currently trying to create (100m) buffer around points in R. I have found two very usefull answers, but I still have problems. Here the answers I found: Buffer (geo)spatial points in R with gbuffer Create buffer and count points in R
My problem is that when I create my buffer, I only have one big buffer.
ANFR_IDF is a dataframe. The column "ID" is a unique ID, the column "coordonnees" the coordinates.
ANFR_IDF$lat=as.numeric(gsub(",.*$", "", ANFR_IDF$coordonnees))
ANFR_IDF$lon=as.numeric(gsub(".*, ", "", ANFR_IDF$coordonnees))
coordinates( ANFR_IDF ) <- c( "lon", "lat" )
CRS=CRS("+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0")
proj4string(ANFR_IDF)=CRS
ANFR_IDF <- spTransform(ANFR_IDF,CRS)
test2=gBuffer( ANFR_IDF, width=100,id=ANFR_IDF$ID, byid=TRUE )
Any idea of what can be the problem? Many thanks!