1) Using marmap library. NOAA bathymetry.
This is a good solution, for large areas.
2) GEBCO bathymetry. We need to register in:
http://www.bodc.ac.uk/data/online_delivery/gebco/select/ and after doing the login, simply download the file '.nc' in netCDF format. We can choose between GEBCO_08 Grid (30 arc-second resolution)and 1 arc-minute grid. We can also download only a selected area.
Once the file has been downloaded, either open it using marmap or raster.
# Using marmap package: require(marmap) readGEBCO.bathy("gebco_08_-10_36_-6_42.nc", db = "GEBCO_08") -> med plot(med) class(med) # note that this is a matrix # example from help page: colorRampPalette(c("lightblue","cadetblue1","white")) -> blues # custom col palette plot(med, n=1, im=T, bpal=blues(100)) #n indicates the number of conoutr lines, im goes for the filled contour or just the bathy lines, and bpal defines the colour palette # Using raster package: gebco = raster("gebco_08_-10_36_-6_42.nc") plot(gebco) plot(gebco, col=blues(100)) summary(gebco) # this is now a raster object, that we can overlay in ggplot map, for example.
This comment has been removed by the author.
ReplyDeleteHi, you mention in this post that the 'summary(gebco) # this is now a raster object, that we can overlay in ggplot map, for example'
ReplyDeletehowever, I am trying to do this (add a bathymetry layer to ggplot map) using the code:
new data <- fortify(gebco)
but I get the error 'ggplot2 doesn't know how to deal with data of class character'
Any ideas?