Geographically Mapping the International Border Crossings, colour coded by their infrastructure development.
Data Is Plural
Maps
A4 Size Viz
Author
Aditya Dahiya
Published
April 10, 2024
Michael R. Kenwick and colleagues have compiled the Border Crossings of the World dataset, which examines how state authority is manifested through infrastructure at international borders. Using satellite imagery, the researchers identified the presence of gates, official structures, and split-lane inspection facilities. Their dataset finally computes a overall summary metric called “border orientation score” (measured at the directed border crossing year) that assesses the degree to which a state demonstrates its commitment to controlling the terms of border penetration through spatial displays of its capacities. This information was brought to light by Erik Gahner and Data is Plural (April 17, 2024 Edition) | Data Codebook | Data
How I made this graphic?
Load libraries and Data, Creating custom functions
Code
# Data Wrangling Toolslibrary(tidyverse)library(janitor)library(here)library(dataverse)# Final plot toolslibrary(scales)library(fontawesome)library(ggtext)library(showtext)library(colorspace)library(ggthemes)library(patchwork)# Mapping toolslibrary(rnaturalearth)library(sf)library(patchwork)# Data Load-in, EDA & Data Wrangling border <-get_dataframe_by_id(fileid =4556046,.f = readr::read_tsv,server ="dataverse.harvard.edu") |>as_tibble()# Create a function to draw a bounding box to plot a rectangle on Mapgeometric_rectangle <-function(lat_min, lat_max, lon_min, lon_max) { box_coords <-matrix(data =c(c(lon_min, lon_max, lon_max, lon_min, lon_min),c(lat_min, lat_min, lat_max, lat_max, lat_min) ),ncol =2, byrow =FALSE )return(st_polygon(list(box_coords)) |>st_sfc(crs =4326) # Set the CRS to EPSG:4326, the default )}
Visualization Parameters
Code
# Font for titlesfont_add_google("Scope One",family ="title_font") # Font for the captionfont_add_google("Saira Extra Condensed",family ="caption_font") # Font for plot textfont_add_google("Barlow Semi Condensed",family ="body_font") showtext_auto()bg_col <-"lightblue"# Background Colourtext_col <-"grey15"# Colour for the texttext_hil <-"grey20"# Colour for highlighted text# Define Text Sizets <-40# Text Size# Caption stuffsysfonts::font_add(family ="Font Awesome 6 Brands",regular = here::here("docs", "Font Awesome 6 Brands-Regular-400.otf"))github <-""github_username <-"aditya-dahiya"xtwitter <-""xtwitter_username <-"@adityadahiyaias"social_caption_1 <- glue::glue("<span style='font-family:\"Font Awesome 6 Brands\";'>{github};</span> <span style='color: {text_hil}'>{github_username} </span>")social_caption_2 <- glue::glue("<span style='font-family:\"Font Awesome 6 Brands\";'>{xtwitter};</span> <span style='color: {text_hil}'>{xtwitter_username}</span>")
Plot Text
Code
plot_title <-"International Border Crossings"plot_caption <-paste0("**Data:** Border Crossings of the World by Michael R. Kenwick et al", " | **Code:** ", social_caption_1, " | **Graphics:** ", social_caption_2 )subtitle_text <-"Comparison of Infrastructure at the Border Crossings. West-European and West-African border crossings are the least secured, while Eastern Europe and US-Mexico Border have high checking infrastructure."plot_subtitle <-str_wrap(subtitle_text, width =105)plot_subtitle |>str_view()
Data Analysis and Wrangling
Code
# Data on Border Crossings - Selected Fields to plot on the World Mapplotdf <- border |> dplyr::select(borderid, country1, country2, lat, long, theta, visa_waiver) |>group_by(borderid) |>summarise(lat =mean(lat), lon =mean(long),theta =mean(theta),visa_waiver =mean(visa_waiver) ) |>st_as_sf(coords =c("lon", "lat"), crs =4326)# Getting a World Map for Base Plotworld <-ne_countries(scale ="large",type ="countries",returnclass ="sf")# Adding the politically correct map of India to the World Map by ne_countries()india_correct <-read_sf(here("data", "india_map", "India_State_Boundary.shp")) |>st_simplify(dTolerance =500) |> rmapshaper::ms_dissolve() |># removing the internal state borders rmapshaper::ms_simplify(keep =0.2) # removing left over multiploygons