4.3 Bounding Boxes

Antarctica_map <- map(fill = TRUE, plot = FALSE) |>
  st_as_sf() |>
  filter(ID == "Antarctica")

Antarctica_map |> 
  ggplot() + 
  geom_sf() +
  labs(title = "Antarctica", 
       subtitle = "Think of the latitude",
       caption = "Spatial Data Science book club")

st_bbox(Antarctica_map)
##       xmin       ymin       xmax       ymax 
## -180.00000  -85.19218  179.62032  -60.52090

which clearly does not contain the region (ymin being -90 and xmax 180).

Fiji_map <- map(fill = TRUE, plot = FALSE) |>
  st_as_sf() |>
  filter(ID == "Fiji")

Fiji_map |> 
  ggplot() + 
  geom_sf() +
  labs(title = "Fiji", 
       subtitle = "Think of the longitude",
       caption = "Spatial Data Science book club")

st_bbox(Fiji_map)
##       xmin       ymin       xmax       ymax 
## -179.86734  -21.70586  180.17769  -12.47695

seems to span most of the Earth

4.3.1 Spherical Coordinates

s2_bounds_cap(Antarctica_map)
##   lng lat   angle
## 1   0 -90 29.4791
s2_bounds_rect(Antarctica_map)
##   lng_lo lat_lo lng_hi   lat_hi
## 1   -180    -90    180 -60.5209
s2_bounds_rect(Fiji_map)
##     lng_lo    lat_lo    lng_hi    lat_hi
## 1 174.5872 -21.70586 -178.2511 -12.47695