Skip to content
Prev 22312 / 29559 Next

Move all the polygon vertices

You need the sp package for making spatial polygons objects and the
rgeos package for doing buffering:

library(sp)
# convert your `r1` into a SpatialPolygons object:

p = SpatialPolygons(list(Polygons(list(Polygon(r1)),ID=1)))
plot(p)

library(rgeos)
# use a negative buffer for inside buffers:
bp = gBuffer(p, width=-30)
plot(bp, add=TRUE)

That should do it...

Barry



On Mon, Feb 9, 2015 at 5:09 PM, Alexandre Santos
<alexandresantosbr at yahoo.com.br> wrote: