South Up Equal Earth Projection in R
Yup - I'm still banging on about this! This time, in R
Result

The colours are wrong, and the labels need adjustment - but not bad for a few lines of code!
Code
R
library(tidyverse) library(rnaturalearth) library(rnaturalearthdata) library(sf) centre <- 160 # NZ mostly centred, prevents Africa and South America wrapping. projection <- "eqearth" # Other good projections are wag1 wag7 eck4 eqearth crs_string <- paste( "+proj=", projection, " +lon_0=", centre, " +axis=wsu", sep="") # WSU puts South up target_crs <- st_crs( crs_string ) worldrn <- ne_countries( scale = "medium", returnclass = "sf" ) %>% st_make_valid() offset <- 180 - centre # Recalculate the polygons polygon <- st_polygon( x = list(rbind( c(-0.0001 - offset, 90), c(0 - offset, 90), c(0 - offset, -90), c(-0.0001 - offset, -90), c(-0.0001 - offset, 90) ))) %>% st_sfc() %>% st_set_crs(4326) # modify world dataset to remove overlapping portions with world's polygons world2 <- worldrn %>% st_difference(polygon) # Transform world3 <- world2 %>% st_transform(crs = target_crs) ggplot(data = world3, aes(group = admin)) + #geom_sf( fill = "red" ) + geom_sf( fill = world3$mapcolor13, lwd = 0 ) + # remove borders geom_sf_label( aes( label = name_long ), label.size = 0, fill = NA, size = 1 ) + theme( panel.grid.major = element_line( color = gray(.5), linetype = "dashed", size = 0.5 ), panel.background = element_rect( fill = "#A7C7E7")) # Uncomment to save the map #ggsave("map.png", width = 32, height = 18, units = "cm")
Further Reading
- https://gis.stackexchange.com/a/287094/129854
- https://r-spatial.org/r/2018/10/25/ggplot2-sf.html
- https://www.jasondavies.com/maps/raster/
- https://stackoverflow.com/questions/68278789/how-to-rotate-world-map-using-mollweide-projection-with-sf-rnaturalearth-ggplot
my favourite is the aboriginal conception/orientation of australia in the centre of the map 🥰
Reply to original comment on twitter.com
|🌎🌍🌏 < now we just need a new emoji!
Reply to original comment on twitter.com
|