R/clip_shapefile.R
clip_shapefile.RdClips an area from a larger shape file (SpatialPolygons).
clip_shapefile( x, limits = NULL, proj4.limits = "+proj=longlat +datum=WGS84 +no_defs +ellps=WGS84 +towgs84=0,0,0", simplify = FALSE, tol = 60, return.boundary = FALSE )
| x | Original shape file to be clipped. Required. Must contain |
|---|---|
| limits | The constraining area used to clip |
| proj4.limits | The |
| simplify | Should the |
| tol | Numerical tolerance value to be used for simplification. See |
| return.boundary | logical. If |
The function uses the gIntersection function to clip smaller SpatialPolygons from larger ones. The clip area is constrained by either a numeric vector or SpatialPolygons object in the limits argument. One of these arguments must be given. Defining limits by a SpatialPolygons object gives greater freedom for the clip area as the area does not have to be rectangular.