clip_shapefile {ggOceanMaps} | R Documentation |
Clip a shapefile using a bounding area
Description
Clips an area from a larger shapefile provided in sf or sp formats.
Usage
clip_shapefile(
x,
limits,
proj.limits = 4326,
simplify = FALSE,
tol = 60,
return.boundary = FALSE,
extra.validate = FALSE
)
Arguments
x |
Original shapefile to be clipped as a an sf or |
limits |
The constraining area used to clip |
proj.limits |
The |
simplify |
Should the |
tol |
Numerical tolerance value to be used for simplification. See |
return.boundary |
Logical. If |
extra.validate |
Logical indicating whether |
Details
The function uses the st_intersection
function to clip smaller polygons from larger ones. The clip area is constrained by either a numeric vector or a spatial object in the limits
argument. Defining limits
by a sf
object gives greater freedom for the clip area as the area does not have to be rectangular.
Value
Clipped spatial object. If return.boundary = TRUE
, a list containing the shapefile together with the clip boundary.
Author(s)
Mikko Vihtakari
See Also
Other create shapefiles:
geonorge_bathymetry()
,
raster_bathymetry()
,
vector_bathymetry()