get.bathy {oceanmap} | R Documentation |
Returns bathymetric data from the NOAA ETOPO1 database as RasterLayer, given coordinate bounds and resolution.
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
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 |
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 |
... |
additional arguments to be passed to v, used if |
Author(s)
Robert K. Bauer
See Also
v, add.region, region_definitions, regions, writebin, get.bathy
Examples
## 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))