5.9 Clipping

5.9.1 Intersection

nz_intersection = st_intersection(nz, nz_shift_sf)
## Warning: attribute variables are assumed to be spatially constant throughout
## all geometries
nz |>
  ggplot() +
  geom_sf(fill = "red", alpha = 0.25) +
  geom_sf(fill = "blue", alpha = 0.25,
          data = nz_shift_sf) +
  geom_sf(fill = "purple",
          data = nz_intersection) +
  labs(title = "New Zealand",
       subtitle = "Intersection",
       caption = "GeoComputation with R book club") +
  theme_minimal()

5.9.2 Venn Diagrams

R for Data Science