Mapping French rivers network


Author

Affiliation

Etienne Bacher

 

Published

Dec. 27, 2021

Citation

Bacher, 2021


Spanish rivers network, by Dominic Royé

Once again inspired by Dominic Royé’s maps, I decided to map rivers in France. The dataset I use comes from HydroSHEDS. The code below is quite similar to the code in my previous post so I don’t spend a lot of time on it.

library(ggplot2)
library(ggtext)
library(sf)
library(rnaturalearth)
france <- ne_countries(country = "France", scale = 'medium',
                       type = 'map_units', returnclass = 'sf')  

rivers_30sec <- read_sf("eu_riv_30s/eu_riv_30s.shp") |>
  st_intersection(france)
x <- ggplot() +
  geom_sf(
    data = rivers_30sec, 
    color = "#002266"
  ) +
  labs(
    title = "Rivers network in France",
    subtitle = "This map displays 18,099 rivers. These are<br> measured at a grid resolution of 30 arc-seconds<br> (approx. 1km at the equator).",
    caption = "Made by Etienne Bacher &middot; Data from HydroSHEDS"
  ) +
  theme_void() +
  theme(
    plot.background = element_rect(fill = "white", color = "white"),
    panel.background = element_rect(fill = "white", color = "white"),
    plot.title = element_markdown(hjust = 0.5, size = 30, margin = margin(t = 10, b = -20)),
    plot.subtitle = element_markdown(margin = margin(t = 40, b = -60, l = 10), size = 12),
    plot.caption = element_markdown(hjust = 0.5, margin = margin(l = 10, b = 20, t = -30)),
    text = element_text(family = "Roboto Condensed")
  )

ggsave("france_30sec.png", plot = x, width = 8, height = 8)

This plot shows the density of rivers in France. Now, if we want to show which rivers are the most important, we can modify the opacity of the lines depending on their flow:

x <- ggplot() +
  geom_sf(
    data = rivers_30sec, 
    mapping = aes(alpha = UP_CELLS),
    color = "#002266"
  ) +
  labs(
    title = "Rivers network in France",
    subtitle = "This map displays 18,099 rivers. These are<br> measured at a grid resolution of 30 arc-seconds<br> (approx. 1km at the equator). Line opacity<br> represents the size of the flow.",
    caption = "Made by Etienne Bacher &middot; Data from HydroSHEDS"
  ) +
  theme_void() +
  theme(
    plot.background = element_rect(fill = "white", color = "white"),
    panel.background = element_rect(fill = "white", color = "white"),
    plot.title = element_markdown(hjust = 0.5, size = 30, margin = margin(t = 10, b = -20)),
    plot.subtitle = element_markdown(margin = margin(t = 40, b = -60, l = 10), size = 12),
    legend.position = "none",
    plot.caption = element_markdown(hjust = 0.5, margin = margin(l = 10, b = 20, t = -30)),
    text = element_text(family = "Roboto Condensed")
  )

ggsave("france_30sec_opac.png", plot = x, height = 8, width = 8)

Footnotes

    Corrections

    If you see mistakes or want to suggest changes, please create an issue on the source repository.

    Reuse

    Text and figures are licensed under Creative Commons Attribution CC BY 4.0. Source code is available at https://github.com/etiennebacher/personal_website_distill, unless otherwise noted. The figures that have been reused from other sources don't fall under this license and can be recognized by a note in their caption: "Figure from ...".

    Citation

    For attribution, please cite this work as

    Bacher (2021, Dec. 27). Etienne Bacher: Mapping French rivers network. Retrieved from https://www.etiennebacher.com/posts/2021-12-27-mapping-french-rivers-network/

    BibTeX citation

    @misc{bacher2021mapping,
      author = {Bacher, Etienne},
      title = {Etienne Bacher: Mapping French rivers network},
      url = {https://www.etiennebacher.com/posts/2021-12-27-mapping-french-rivers-network/},
      year = {2021}
    }