Skip to content

Bathymetry data #1

Description

@pennybeaver

Hi Martijn, I am trying to work out how to add bathymetry lines to a tmap, I have tried converting a marmot bathymetry map of the area I specifically would like to use, as.raster but I am unable to use so far in tmap. The maps are for a species of shearwater I am researching showing their habitat use. Can I add bathymetry data to tmap?

or is there a better way to do it in tmap by not using marmap, I am getting a lot of errors and wandering if tmap and marmap are not compatible?

Kind regards
Penny
tmap wedgies.pdf
marmap1-bathy.pdf

#Create the bathymetry map using marmap

library(marmap)
papoue <- getNOAA.bathy(lon1 = 100, lon2 = 180, lat1 = -60, lat2 = 40, resolution = 15)
plot(papoue, land = TRUE, deep = c(-9000, -3000, 0),
     shallow = c(-3000, -10, 0),
     step = c(1000, 1000, 0),
     lwd = c(0.8, 0.8, 1), lty = c(1, 1, 1),
     col = c("lightgrey", "darkgrey","black"),
     drawlabel = c(FALSE, FALSE, FALSE))

bathy<-marmap::as.raster(papoue)
class(bathy)

#Create a map using data from wedgetailed shearwaters from Muttonbid Island

library(tmap)
library(tmaptools)
data(World)
tmap_mode("plot")
library(raster)

#add it to tmap maps?
tmap::tm_shape(mtnr)+tm_raster(palette = "YlGnBu", legend.show = FALSE)+tm_shape(World)+tm_borders()+
  tm_grid(col ="gray80", alpha = 0.3)+tm_fill(col = "black")+
  tm_xlab("Longitude", size = 0.8)+tm_ylab("Latitude", size = 0.8)+
  tm_layout(title = "(a) n = 19", scale = 0.7, main.title.size = 0.8,title.position = c('left','bottom'))+
  tm_shape(siteMT)+tm_dots(size = 0.2, shape = 8, col = "red")+
  tm_shape(siteMG)+tm_dots(size = 0.2, shape = 8, col = "green")+
  tm_shape(siteGI)+tm_dots(size = 0.2, shape = 8, col = "green")

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions