Inaccessibility | R bloggers

Inaccessibility | R bloggers

[This article was first published on r.iresmi.net, and kindly contributed to R-bloggers]. (You can report a problem with the content on this page here)


Want to share your content on R bloggers? click here if you have a blog, or here if you don’t.

IMG_9811 – CC-BY-NC by Eddie Lawrance

Day 7 of 30 Day Card Challenge: « Accessibility » (earlier).

Well, let’s be rebellious and seek inaccessibility instead; more precisely the pole of inaccessibility of France (de Hexagon): the furthest location from the border. Not to be confused with the center of gravity.

library(sf)
library(dplyr)
library(ggplot2)
library(glue)
library(purrr)
library(polylabelr)

Facts

We will again use the French administrative units (get the facts from here after).

# France boundary
fr <- read_sf("~/data/adminexpress/adminexpress_cog_simpl_000_2022.gpkg",
              layer = "region") |>
  filter(insee_reg > "06",
         insee_reg != "94") |> 
  st_transform("EPSG:2154") |> 
  st_union()

# French communes to get the point name
com <- read_sf("~/data/adminexpress/adminexpress_cog_simpl_000_2022.gpkg",
               layer = "commune") |>
  filter(insee_reg > "06",
         insee_reg != "94") |> 
  st_transform("EPSG:2154")

Calculate the POI

Determine the inaccessibility pole of France with {polylabelr} and intersect it with the local authority low to find the nearest city.

fr_poi <- poi(fr) |> 
  pluck(1) |> 
  as_tibble() |> 
  st_as_sf(coords = c("x", "y"), crs = "EPSG:2154") |> 
  st_join(com)

fr_poi_circle <- fr_poi |> 
  mutate(geometry = st_buffer(geometry, dist))

fr_centroid <- fr |> 
  st_centroid()

It appears to be inside Saint-Palais in the Cher department.

Card

fr_poi |> 
  ggplot() +
  geom_sf(data = fr) +
  geom_sf(data = fr_poi_circle, linewidth = 1, linetype = 3) +
  geom_sf(data = fr_centroid, color = "darkgrey") +
  geom_sf() +
  geom_sf_text(aes(label = nom), vjust = -.5) +
  labs(title = "Pole of inaccessibility",
       subtitle = "France",
       x = "", y = "",
       caption = glue("https://r.iresmi.net/ - {Sys.Date()}
                      data from IGN Adminexpress 2022")) +
  theme_minimal() +
  theme(plot.caption = element_text(size = 6, 
                                    color = "darkgrey"))
Map of France with a point in the center with the inscription Saint-Palais, the pole of inaccessibility

Figure 1: Inaccessibility pole of France (black). The gray dot is the center of gravity


#Inaccessibility #bloggers

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *