13  Map projections

library(tmap)
library(sf)
library(stars)
worldelevation = read_stars("data/worldelevation.tif")
worldvector = read_sf("data/worldvector.gpkg")
worldcities = read_sf("data/worldcities.gpkg")
tm = tm_shape(worldvector) +
  tm_polygons() +
  tm_shape(worldcities) +
  tm_dots() +
  tm_text("name")
tm

tm + 
  tm_crs("auto")

tm +
  tm_crs("+proj=eck4") +
  tm_layout(earth_boundary = TRUE, frame = FALSE)

tm +
  tm_crs("+proj=eck4") +
  tm_layout(earth_boundary = TRUE, frame = FALSE)

tm_shape(worldvector, bbox = "FULL") +
  tm_polygons() +
  tm_graticules() +
  tm_crs("+proj=ortho +lat_0=30 +lon_0=0")+
  tm_layout(earth_boundary = TRUE, frame = FALSE)