Extracts the land area from a bathyRaster object produced
by raster_bathymetry and returns it as an
sf polygon layer suitable for use in the
shapefiles argument of basemap. Warning: processing
may take a long time if the bathymetry raster is large.
Arguments
- bathy
A
bathyRasterobject fromraster_bathymetry. Land cells must be detectable either asNA(the default whendepths = NULLorestimate.land = FALSE) or as the factor level"land"(whenestimate.land = TRUE).- drop.crumbs
Single numeric value specifying a threshold (area in km2) for disconnected polygons which should be removed. Set to
NULLto bypass the removal. Uses the drop_crumbs function.- remove.holes
Single numeric value specifying a threshold (area in km2) for holes which should be removed. Set to
NULLto bypass the removal. Uses the fill_holes function. Currently VERY slow.- smooth
Logical indicating whether the pixelated contours should be smoothed. Uses the smooth_ksmooth function.
Value
An sf object containing the land polygons in
the same projection as bathy$raster.
Details
The drop.crumbs and remove.holes arguments can be used
to reduce the resulting file size. The smooth argument removes the
pixelated contours but increases file size and biases the polygon with
respect to the underlying raster.
Use vector_land() together with vector_bathymetry to
build a matched land + bathymetry pair from a single source raster (e.g.
GEBCO, ETOPO, IBCAO) — see the example.
See also
raster_bathymetry, vector_bathymetry
Other create shapefiles:
clip_shapefile(),
geonorge_bathymetry(),
raster_bathymetry(),
vector_bathymetry(),
wcs_bathymetry()