get.bathy: Returns bathymetric data from the NOAA ETOPO1 database as...

Description Usage Arguments Author(s) See Also Examples

View source: R/get.bathy.r

Description

Returns and optionally stores bathymetric data from the ETOPO1 database hosted on the NOAA server as a RasterLayer, based on the defined resolution and provided coordinate bounds or region definition. Stored bathymetry files can be reloaded through the same function call.

Usage

1
2
get.bathy(v_area, lon, lat, resolution=4, keep=F ,
          savename.bathy, folder.bathy, visualize=T, terrain=F,...)

Arguments

v_area

character string identifying the region that should be plotted, or in case of x == 'bathy', also a Raster* or Extent object. If missing, region is derived from the '.gz'-filename. See region_definitions for area definitions and use add.region to add new regions.

lon,lat

longitude and latitude describing the extend of the region of interest.

resolution

resolution of the bathymetric grid, in minutes (default is 4).

keep

whether to write the data downloaded from NOAA into a file (default is FALSE).

savename.bathy

savename for the bathymetric data file, if not specified set to type 'bathy_lon-lat_res.resolution.dat' or 'bathy_v_area_res.resolution.dat'.

folder.bathy

directory where bathymetric data should be saved (default is current working directory).

visualize

whether the bathymetric data should be plotted instantly.

terrain

whether the to keep terrain data (default is FALSE). If set FALSE and visualize is TRUE, grid command in plotmap is disabled!

...

additional arguments to be passed to v, used if visualize is set TRUE.

Author(s)

Robert K. Bauer

See Also

v, add.region, region_definitions, regions, writebin, get.bathy

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
## Example 1: load & plot bathymetry of the Baltic Sea, defined by longitudes and latidtues
lon <- c(9, 31)
lat <- c(53.5, 66)
# get.bathy(lon=lon, lat=lat, main="Baltic Sea", cbpos='r')

## Example 2: plot bathymetry using a v_area-keyword
#get.bathy("lion",res=4, keep=T) # can take some time, requires server connection!
#get.bathy("lion",res=1, keep=T,visualize=FALSE)

## Example 3: plot landmask of the Baltic Sea defined by an extent- or raster-object
library('raster')
ext <- extent(lon,lat)
#get.bathy(ext,visualize=T,main="Baltic Sea",res=4,levels=200) # extent-object

## Example 4: plot bathymetry and topography of the western Mediterranean Sea
### a) download, assign and save bathymetry
# bathy <- get.bathy("medw4",visualize=F,terrain=T,res=3,keep=T)
# # load('bathy_medw4_res.3.dat',verbose = T); bathy <- h
# par(mfrow=c(2,1))
# v(bathy,param="bathy",subplot = T)
# get.bathy("medw4",visualize=T,terrain=F,res=3,levels=c(200,2000), 
# subplot = T,grid=F) # show contours

### b) only contour lines:
# par(mfrow=c(1,2))
# h <- get.bathy("lion",visualize=T,terrain=F,res=3,levels=c(200,2000),
#                v_image=F, subplot=T,grid=F)

### use v-function for same plot but on subregion:
# v(h,v_area = "survey", param="bathy",subplot = T, v_contour = T, 
#   v_image = F, levels=c(200,2000)) 

oceanmap documentation built on March 23, 2020, 5:06 p.m.

Related to get.bathy in oceanmap...