The Final Map

Welcome to #30DayMapChallenge 2024 Day 30

The Final Map
Published

November 30, 2024

The Final Map
library(tidyverse)
library(sf)
library(rnaturalearth)
library(rnaturalearthdata)
library(showtext)
font_add_google(name = 'Recursive', 
                family = 'Recursive')
showtext_auto()
bathy <- marmap::getNOAA.bathy(lon1 = -180, lon2 = 180,
                               lat1 = -90, lat2 = 90,
                               res = 15, keep = TRUE,
                               antimeridian=TRUE)
sp_grid <- marmap::as.SpatialGridDataFrame(bathy)
sp_grid
df <- as.data.frame(sp_grid) %>%
  rename(lon=s1, lat=s2) 

df_sf <- df %>%
  sf::st_as_sf(coords = c("lon", "lat"), 
               crs = 4326) %>%
  sf::st_transform(crs = "+proj=rpoly") 
df_sf
# Load world data
world <- ne_countries(scale = "medium", 
                      returnclass = "sf") %>%
  sf::st_transform(crs = "+proj=rpoly")  %>%
  sf::st_make_valid()
ggplot() +
  geom_sf(data = df_sf, 
          aes(color = layer),
          show.legend = F)+
  geom_sf(data = world,
          fill = "#d1cdb5", 
          color = NA, alpha = 0.7) +  # Land
  coord_sf()+
  labs(title = "The Earth Without Borders",
       subtitle = "A water-centric view in Rectangular Polyconic projection",
       caption = "Source: Natural Earth | #30DayMapChallenge Day30 | @fgazzelloni") +
  theme(text = element_text(family = "Recursive"),
        plot.title = element_text(size = 44, 
                                  face = "bold", 
                                  hjust = 0.5),
        plot.subtitle = element_text(size = 20, 
                                     hjust = 0.5, 
                                     color = "gray50"),
        plot.caption = element_text(size = 20, 
                                    hjust = 0.5, 
                                    color = "gray70"),
        plot.background = element_rect(fill = "#f7f7f5", 
                                       color = NA))
ggsave("day30_the_final_map.png", 
       bg = "white",
       width = 8, height = 8, 
       units = "cm")