Introduction and Main Facts

Cartography has long wrestled with a fundamental geometric dilemma: how to faithfully represent a three-dimensional, spherical world on a flat two-dimensional surface without introducing severe distortions. Traditional flat maps, most notably the ubiquitous Mercator projection, notoriously exaggerate the size of landmasses situated far from the equator—making Greenland appear roughly the same size as the African continent, when in reality, Africa is roughly fourteen times larger.

To combat this perceptual bias, geographers developed equal-area projections, which preserve the true relative sizes of continents and oceans at the cost of breaking up continuous surfaces. Among the most creative and effective solutions is the Interrupted Goode Homolosine projection, an equal-area, composite pseudocylindrical map projection that slices up the oceans to minimize distortion, famously evoking the imagery of peeling a spherical orange and laying its skin flat.

In a recent and elegant demonstration of modern programmatic cartography, data scientist and geospatial developer Diego Hernangómez showcased how to construct, manipulate, and stylize this complex map using the R programming language. By leveraging core spatial packages—specifically sf for handling simple features, giscoR for retrieving official European Union geographical data, and ggplot2 for high-performance visualization—developers can now render this intricate "orange peel" map in mere seconds.

The resulting visualization not only serves as an educational tutorial for R programmers interested in advanced spatial data visualization, but it also revives a classic twentieth-century cartographic masterpiece using modern open-source tooling, complete with a bespoke citrus-themed color palette.


Chronology of Cartographic Innovation and Spatial Computing

The evolution of the project bridges decades of cartographic history with contemporary data science frameworks. Understanding how this visualization comes to life requires looking at both the historical development of the projection and the programmatic steps taken to render it in R.

The Historical Roots of Equal-Area Mapping

  • 1925: American geographer John Paul Goode introduces the Goode homolosine projection (initially called the "Homolosine" projection). By combining elements of the Mollweide projection (which is equal-area) and the Sinusoidal projection, Goode creates a map that minimizes distortion across both high and low latitudes.
  • Mid-20th Century: The projection is increasingly "interrupted"—slicing the oceans rather than the landmasses—to keep continents intact and shape-accurate, making it a staple in geographical education and atlases.
  • Modern Era: The advent of digital cartography and open-source GIS libraries (such as PROJ) standardizes the mathematical transformations required to project spatial data into complex coordinate reference systems (CRS) like +proj=igh.

The Computational Workflow in R

  • Phase 1: Defining Spatial Boundaries and Outlines. Using giscoR to pull global coastal data at a 10-resolution scale, the R script establishes the coordinate reference system (goode_crs <- "+proj=igh"). It then defines complex polygon vectors (lon and lat) to trace the exact external boundaries and lobed cuts of the Goode projection, generating a bounding box and a masking layer (mask) to keep edges pristine.
  • Phase 2: Constructing Lobes and Graticules. Because standard graticules (lines of latitude and longitude) would cross awkwardly over the interrupted oceanic cuts, the script divides the globe into six distinct longitudinal and latitudinal lobes. It generates separate meridians and parallels for each individual lobe using lapply loops, preventing visual bleeding across the gaps.
  • Phase 3: Stylization and Rendering. Utilizing ggplot2, the map is layered with custom hex-code colors—soft creams (#FFF0D9) for the background cutout, warm orange fills (#F9B566) with deeper borders (#B34D08) for coastlines, and a cohesive citrus palette that drives home the "peeled orange" metaphor.

Supporting Data and Technical Implementation

Recreating the Interrupted Goode Homolosine projection programmatically demands a sophisticated handling of vector geometries, coordinate transformations, and layered masking. Below is an in-depth breakdown of the R code mechanics required to build the visualization, accompanied by the technical parameters that govern its execution.

Code Architecture and Package Ecosystem

The project relies on three foundational pillars of the modern R spatial ecosystem:

  1. sf (Simple Features for R): The gold standard for vector data handling, allowing users to manipulate points, lines, polygons, and spatial bounding boxes natively within data frames.
  2. giscoR: A wrapper package providing access to geographical information and maps from GISCO (Geographical Information System of the Commission), ensuring high-quality, standardized global vector outlines.
  3. ggplot2: Powered by the Grammar of Graphics, it enables granular, layer-by-layer customization of geometric objects, coordinate systems, and aesthetic themes.

Step-by-Step Technical Breakdown

1. Extracting Coastlines and Establishing the Mask

The script begins by fetching global coastline boundaries via gisco_get_coastal_lines(). To achieve the iconic "peel" effect, it constructs a complex polygon outline that mirrors the cuts of the Goode projection.

library(sf)
library(ggplot2)
library(giscoR)

world <- gisco_get_coastal_lines(resolution = 10)
goode_crs <- "+proj=igh"

# Defining vertices for the lobe cuts
lat <- c(90:-90, rep(c(-90:0, 0:-90), 3), -90:90, 90:0, 0:90, 90)
lon <- c(
  rep(180, 181),
  rep(c(80.01, 79.99, -19.99, -20.01, -99.99, -100.01), each = 91),
  rep(-180, 181),
  rep(c(-40.01, -39.99), each = 91),
  180
)

outline <- st_sfc(st_polygon(list(cbind(lon, lat))), crs = 4326) |&gt;
  st_transform(goode_crs)

rectangle <- st_as_sfc(st_bbox(outline) * 1.1)
mask <- st_difference(rectangle, outline)

By creating a bounding rectangle scaled up by 10% and subtracting the projected outline (st_difference), the developer generates a mask layer. This mask acts as a clean white border that covers any errant data points falling outside the precise lobes of the map projection.

2. Segmenting Graticules by Lobe

A common pitfall when projecting interrupted maps is the erroneous connection of longitude and latitude lines across oceanic voids. To solve this, the globe is segmented into six distinct spatial lobes:

lobes <- list(
  c(-180, -40, 0, 90), c(-40, 180, 0, 90),
  c(-180, -100, -90, 0), c(-100, -20, -90, 0),
  c(-20, 80, -90, 0), c(80, 180, -90, 0)
)

For each lobe, meridians (every 30 degrees) and parallels (every 30 degrees between -60 and 60 latitudes) are generated independently. This guarantees that gridlines terminate cleanly at the edge of each lobe rather than stretching across the Atlantic or Pacific gaps.

3. Assembling the Visual Layers in ggplot2

The final rendering stacks multiple geometry layers (geom_sf) to achieve a polished, publication-ready output:

  • Base Fill: Fills the interior of the projection lobes with a very pale cream (#FFF0D9).
  • Landmasses: Renders the coastlines with a vibrant orange fill (#F9B566) and a darker rust outline (#B34D08).
  • Graticules: Overlays the internal grid lines in a softer golden-orange hue (#E8A45B).
  • Masking: Applies the solid white mask to crop rough edges.
  • Outline Stroke: Draws a crisp border (#E87516) around the entire peeled shape to define its silhouette.

Official Responses and Expert Community Perspectives

The cartographic and R data science communities have responded enthusiastically to Hernangómez’s tutorial, viewing it as a masterclass in combining aesthetic creativity with advanced GIS programming.

Prominent data visualization experts have pointed out that while software packages like QGIS and ArcGIS handle projection transformations natively, scripting them in R opens up automated pipelines for generating customized, data-driven world maps at scale. The technique builds directly upon foundational methodologies established by spatial visualization pioneers such as Claus O. Wilke, whose work on practical ggplot2 cartography heavily informed the masking and outline strategies used here.

Furthermore, European cartographic circles have praised the tutorial for highlighting the broader challenges of map projections. As noted in recent French cartographic guides (such as Pyranhia’s compendium on advanced projections), choosing the wrong map projection can severely distort a spatial data analysis—making equal-area projections like Goode’s essential for ecological, demographic, and economic mapping where land area proportionality is paramount.


Implications for Data Science, Education, and Cartography

The successful recreation of the Interrupted Goode homolosine projection using open-source R packages carries several important implications across multiple disciplines:

1. Democratizing Advanced Cartography

Historically, creating custom interrupted projections required specialized cartographic software and extensive manual layout work. By reducing the process to a reproducible script utilizing sf and ggplot2, complex spatial projections become accessible to students, researchers, and journalists who may not have formal training in GIS software.

2. Improving Spatial Literacy and Perception

Map projections shape how human beings perceive geopolitics. Standard rectangular maps consistently diminish the visual importance of equatorial and southern hemisphere nations. By popularizing equal-area alternatives through engaging tutorials, data scientists help shift public perception toward more geographically honest representations of the planet.

3. Expanding the Boundaries of R Graphics

While ggplot2 is primarily celebrated for statistical charts—such as scatter plots, bar charts, and density curves—this implementation demonstrates its robust capability as a full-fledged cartographic engine. By treating map features as geometric layers, R users can push the aesthetic boundaries of data visualization, merging technical precision with artistic design.


References and Further Reading

  • Wilke, Claus O. Practical R 4&5: Interrupted Goode homolosine projection. Available via Wilke Lab GIS Articles.
  • Hernangómez, Diego. Do you know the interrupted Goode homolosine projection? Geospatial development blog and code repository. Available at Dieghernan GitHub Blog.
  • Pyranhia. Projections cartographiques : le guide pour ne pas y laisser sa santé mentale. French cartographic reference guide. Available via Pyranhia.eu.
  • PROJ Coordinate Transformation Software Library. Documentation on the Interrupted Goode Homolosine (+proj=igh) projection parameters. Available at PROJ.org.

By Asro