get_iso_polys: Generate Polygons from Isobaths

View source: R/get_iso_polys.R

get_iso_polysR Documentation

Generate Polygons from Isobaths

Description

From an input bathymetry and chosen depths, turns areas between isobaths into polygons. An input polygon may optionally be given to constrain boundaries. The accuracy is dependent on the resolution of the bathymetry raster (see load_Bathy to get high resolution data).

Usage

get_iso_polys(Bathy, Poly = NULL, Depths)

Arguments

Bathy

bathymetry raster with the appropriate projection, such as SmallBathy. It is highly recommended to use a raster of higher resolution (see load_Bathy).

Poly

optional, single polygon inside which isobaths will be computed. May be created using create_Polys or by subsetting an object obtained using one of the load_ functions (see examples).

Depths

numeric, vector of desired isobaths. For example, Depths=c(-2000,-1000,-500).

Value

Spatial object in your environment. Data within the resulting object contains a polygon in each row. Columns are as follows: ID is a unique polygon identifier; Iso is an isobath identifier; Min and Max is the depth range of isobaths; Grp is a group identifier (e.g., a seamount constituted of several isobaths); AreaKm2 is the polygon area in square kilometers; Labx and Laby can be used to label groups (see examples).

See Also

load_Bathy, create_Polys, get_depths.

Examples


# For more examples, see:
# https://github.com/ccamlr/CCAMLRGIS#46-get_iso_polys


Poly=create_Polys(Input=data.frame(ID=1,Lat=c(-55,-55,-61,-61),Lon=c(-30,-25,-25,-30)))
IsoPols=get_iso_polys(Bathy=SmallBathy(),Poly=Poly,Depths=seq(-8000,0,length.out=10))

plot(st_geometry(Poly))
for(i in unique(IsoPols$Iso)){
  plot(st_geometry(IsoPols[IsoPols$Iso==i,]),col=rainbow(9)[i],add=TRUE)
}



CCAMLRGIS documentation built on Sept. 27, 2023, 9:09 a.m.