get_iso_polys {CCAMLRGIS} | R Documentation |
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).
get_iso_polys(Bathy, Poly = NULL, Depths)
Bathy |
bathymetry raster with the appropriate projection, such as
|
Poly |
optional, single polygon inside which isobaths will be computed.
May be created using |
Depths |
numeric, vector of desired isobaths. For example,
|
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).
load_Bathy
, create_Polys
, get_depths
.
# 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)
}