Possible solutions to exercises of day 1

Rendered version here

  1. What is the coordinate reference system of the ne_countries() dataset, imported above?

A:

library(rnaturalearth)
library(sf)
## Linking to GEOS 3.12.2, GDAL 3.11.4, PROJ 9.4.1; sf_use_s2() is TRUE
ne_countries() |> st_crs()
## Coordinate Reference System:
##   User input: WGS 84 
##   wkt:
## GEOGCRS["WGS 84",
##     DATUM["World Geodetic System 1984",
##         ELLIPSOID["WGS 84",6378137,298.257223563,
##             LENGTHUNIT["metre",1]]],
##     PRIMEM["Greenwich",0,
##         ANGLEUNIT["degree",0.0174532925199433]],
##     CS[ellipsoidal,2],
##         AXIS["latitude",north,
##             ORDER[1],
##             ANGLEUNIT["degree",0.0174532925199433]],
##         AXIS["longitude",east,
##             ORDER[2],
##             ANGLEUNIT["degree",0.0174532925199433]],
##     ID["EPSG",4326]]

This means: a geographic coordinate system (axis units are degrees), and referenced to the WGS84 ellipsoid.

2/3. Look up the “Equidistant Cylindrical (Plate Carrée)” projection on the https://proj.org website. Why is this projection called The simplest of all projections?

A: it is the simplest because latitude and longitude are essentially taken as y and x, possibly after a linear transform.

  1. Project ne_countries to Plate Carrée, and plot it with axes=TRUE. What has changed? (Hint: st_crs() accepts a proj string to define a coordinate reference system (CRS); st_transform() transforms a dataset to a new CRS.)
plate_carree = st_crs("+proj=eqc")
ne_countries() |> st_transform(plate_carree) -> ne.pc
plot(ne.pc["sovereignt"], axes = TRUE)

  1. Project the same dataset to Eckert IV projection. What has changed?
eck4 = st_crs("+proj=eck4")
ne_countries() |> st_transform(eck4) -> ne.e4
plot(ne.e4["sovereignt"], axes = TRUE)

  1. Also try plotting this dataset after transforming it to an orthographic projection with +proj=ortho; what went wrong?
ortho = st_crs("+proj=ortho")
ne_countries() |> st_transform(ortho) -> ne.or
plot(ne.or["sovereignt"], axes = TRUE)

What went wrong? Some countries are missing, in particular those which appear only partially in this projection. See here for an example where this problem has been addressed. R is not a GIS!