I have this polygon:
library(maptools); library(sp)
setwd(system.file("shapes", package="maptools"))
columbus <- readShapeSpatial("columbus.shp")
proj4string(columbus) <- CRS("+proj=longlat +ellps=WGS84 +datum=WGS84")
columbus <- spTransform(columbus, CRS("+proj=laea +lat_0=52 +lon_0=10 +x_0=4321000 +y_0=3210000 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs"))
I need to buffer 1km around the polygon, so I tried this:
library(rgeos)
gBuffer(columbus, width = 1000)
Could someone tell me if buffering by width=1000
is buffering by 1km?
Best Answer
It depends on the units. If you are using metric system (like UTM), than 1000 is indeed 1 km. If the units are in WGS (degrees), than you have to first convert your data to metric system (
spTranspform
inrgdal
package) and then you can usegBuffer
with 1000 width.Columbus data are in WGS (you can see it by the fact, that coordinates are around 9 or 10).
Therefore you have to transforms them. I am not sure, which CRS you use, but it seems to be metric, so in that case, width 1000 equal to 1 km.