Function to create a buffer around a SpatialPolygons or SpatialPolygonsDataFrame object. This is a wrapper for gBuffer() function from package rgeos adding transformation of planar coordinates to appropriate projected coordinates to enable creation of buffer.

create_buffer(x, buffer, country)

Arguments

x

A class SpatialPolygons or SpatialPolygonsDataFrame object defining the area to be buffered

buffer

A numeric value for distance (in kilometres) to expand the borders of the given spatial object x. Negative values allowed.

country

Name of country where sampling area is located. This is used to determine the appropriate UTM projection to transform x

Value

A SpatialPolygons with the same CRS as x

Examples

#