A history of China in maps - territory and the Great Wall

This notebook walks down two and a half millennia of Chinese history one map at a time. Each panel shows a single period: the state (or states) that ruled the Chinese world drawn in colour over a faint modern coastline, with the neighbouring polities of the day in grey for context. Overlaid on every map is the course of the Great Wall, so you can watch the frontier sit inside, along, or far beyond the empire’s edge as the centuries turn. Scroll down and read it as a story; the prose between the maps is the running commentary.

What is drawn, and how precise it is

The territorial outlines come from the historical-basemaps project (aourednik/historical-basemaps, CC-BY-SA), which reconstructs world polity borders at fixed years. Historical borders are interpretations, not survey lines - treat them as the shape and reach of a state, not a cadastral boundary. The years were chosen to sit squarely inside each dynasty (e.g. 800 CE for the Tang, 1600 CE for the Ming); a couple of the source’s snapshots lag the textbook dynasty change by a few decades, and where that matters it is noted.

The wall needs an honest caveat. The Great Wall is not one wall but many, built and rebuilt by different dynasties along different lines. Precise, coordinate-level geometry survives in open data only for the Ming wall (the stone-and-brick wall most people picture), here from Adl3rAi/The-Great-Wall-of-China-geodata - 270 surveyed segments dissolved into a single line from Jiayu Pass in the west to the sea at Shanhai Pass in the east. That exact Ming course is drawn in colour on the Ming and Qing maps. On the earlier maps the same Ming line is drawn faint and dashed purely as a geographic reference; the actual Qin and Han walls ran tens to hundreds of kilometres further north (the Qin wall along the Yin Mountains and the Ordos loop, the Han wall pushed west along the Hexi Corridor toward Dunhuang), and the text says so where it matters rather than drawing a line whose precise coordinates we do not have.

Modern coastlines and present-day borders (faint grey) come from Natural Earth, only as a familiar geographic anchor - they are not part of the history.

config <- fromJSON("data.json", simplifyVector = TRUE,
                   simplifyDataFrame = FALSE, simplifyMatrix = FALSE)

extent <- config$display_extent
periods_by_key <- set_names(config$periods, map_chr(config$periods, "key"))

coastline   <- st_read("coastline.geojson", quiet = TRUE)
ming_wall   <- st_read("ming_wall.geojson", quiet = TRUE)
ming_passes <- st_read("ming_passes.geojson", quiet = TRUE)
named_passes <- st_read("named_passes.geojson", quiet = TRUE)

wall_colour <- turbo(10)[9]

The map-drawing function

Every period map is built the same way, so one function does it. It reads that period’s clipped polities, separates the era’s own state(s) - the ones named in the configuration - from the neighbouring context, and layers them over the coastline: context in grey, the highlighted state(s) coloured by name through a discrete viridis scale. The wall is then drawn according to the era. Where the wall is the point of the map (featured for the Ming, internal for the Qing) it is the coloured Ming course, with the fortified passes marked; everywhere else it is a quiet dashed reference line. A fixed coord_sf extent is shared by every panel, so the maps are directly comparable and the empire visibly grows and shrinks.

plot_period <- function(period) {
  polities <- st_read(period$file, quiet = TRUE)
  highlight <- polities |> filter(name %in% period$highlight)
  context   <- polities |> filter(!name %in% period$highlight)

  base_map <- ggplot() +
    geom_sf(data = coastline, fill = "grey97", colour = "grey85", linewidth = 0.2) +
    geom_sf(data = context, fill = "grey88", colour = "white", linewidth = 0.2) +
    geom_sf(data = highlight, aes(fill = name), colour = "white", linewidth = 0.3,
            alpha = 0.9)

  if (period$wall %in% c("featured", "internal")) {
    wall_label <- if (period$wall == "featured") "Great Wall (Ming course)"
                  else "Great Wall (now inside the empire)"
    pass_labels <- named_passes |>
      mutate(lon = st_coordinates(named_passes)[, 1],
             lat = st_coordinates(named_passes)[, 2],
             dx = case_when(name == "Jiayu Pass" ~ -1, name == "Juyong Pass" ~ -3,
                            name == "Shanhai Pass" ~ 4, TRUE ~ 0),
             dy = case_when(name == "Jiayu Pass" ~ -1.7, name == "Juyong Pass" ~ 1.9,
                            name == "Shanhai Pass" ~ -1.9, TRUE ~ 0)) |>
      st_drop_geometry()
    base_map <- base_map +
      geom_sf(data = ming_passes, colour = wall_colour, size = 0.35, alpha = 0.4) +
      geom_sf(data = ming_wall, aes(colour = wall_label), linewidth = 1) +
      geom_sf(data = named_passes, colour = wall_colour, size = 2, shape = 18) +
      geom_text(data = pass_labels, aes(lon + dx, lat + dy, label = name),
                size = 3, colour = "grey25") +
      scale_colour_manual(values = set_names(wall_colour, wall_label), name = NULL)
  } else {
    base_map <- base_map +
      geom_sf(data = ming_wall, colour = "grey45", linewidth = 0.4, linetype = "22")
  }

  base_map +
    scale_fill_viridis_d(option = "mako", begin = 0.25, end = 0.8, name = "State / polity") +
    coord_sf(xlim = c(extent$xmin, extent$xmax),
             ylim = c(extent$ymin, extent$ymax), expand = FALSE) +
    labs(title = period$title, subtitle = period$era, x = NULL, y = NULL) +
    theme(legend.position = "right",
          panel.grid = element_line(colour = "grey92", linewidth = 0.2))
}

Warring States - the age of rival walls (c. 475-221 BCE)

Before there was a China there were the Warring States: seven major powers and a scatter of smaller ones, the fractured remnant of the Zhou order, fighting for supremacy across the North China Plain. This is where walls begin. The northern states - Qin, Zhao, Yan - each threw up long rammed-earth ramparts against the horse nomads of the steppe and against one another. There was no single Great Wall yet, only competing walls. The dashed line below is the future Ming course, shown only so you can orient the later maps; the real walls of this era lay along each state’s own frontier.

plot_period(periods_by_key$warring_states)

Qin and Han - the first empire and the first Great Wall (221 BCE - 220 CE)

In 221 BCE the state of Qin swallowed its rivals and Qin Shi Huang declared himself First Emperor. His general Meng Tian was sent north with a vast levy to tear down the walls between the old states and link the northern ramparts into one continuous frontier against the Xiongnu - the first Great Wall, a line of beaten earth far north of the stone wall tourists walk today. The Han inherited and extended it: the map (drawn at 1 CE, near the Western Han’s peak) shows the empire reaching west in a long arm along the Hexi Corridor, where the Han wall and its beacon towers were pushed out toward Dunhuang and the Jade Gate to guard the Silk Road. The frontier you see here ran well north of the dashed Ming line.

plot_period(periods_by_key$qin_han)

Tang - the cosmopolitan golden age (618-907 CE)

After centuries of division the Tang rebuilt a confident, outward-looking empire that reached deep into Central Asia along the Silk Road, its capital Chang’an the largest city on earth. Tellingly, the Tang barely bothered with walls. A dynasty this strong met the steppe with cavalry, diplomacy and client states rather than masonry; the great wall-building of earlier ages fell into neglect. The map shows the Tang heartland with the Tibetan Empire and the Turkic and Uyghur powers pressing on its western and northern arcs - rivals to be managed in the field, not walled out.

plot_period(periods_by_key$tang)

Song - prosperity behind a lost frontier (960-1279 CE)

The Song presided over an economic and cultural explosion - printing, paper money, gunpowder, Neo-Confucianism - but never recovered the north. The wall lands themselves lay in foreign hands: the Liao (Khitan) to the northeast and the Western Xia (Xixia) to the northwest, shown here in their own colours hemming the Northern Song in. Worse was coming - in 1127 the Jurchen Jin seized the whole north and drove the court south of the Yangtze. For the Song, the old Great Wall frontier was not a defence to manage but territory they simply did not hold, which is why this map shows three states where earlier maps showed one.

plot_period(periods_by_key$song)

Yuan - the wall made meaningless (1271-1368 CE)

Then the people the walls were built to keep out took everything. Kublai Khan completed the Mongol conquest and ruled all of China as the Yuan dynasty, the eastern realm of an empire that stretched to Persia and the Russian steppe. When the same power governs both sides of a frontier, the frontier vanishes: under the Yuan the walls guarded nothing and were left to erode. The map shows the single vast Mongol domain swallowing the lands that the dashed reference line once divided.

plot_period(periods_by_key$yuan)

Ming - the Great Wall as we know it (1368-1644 CE)

The Ming drove the Mongols out and, haunted by them ever after, built the wall everyone pictures. This is the moment the map’s wall turns solid and coloured: the Ming Great Wall, no longer rammed earth but brick and stone with watchtowers and garrisoned passes, running roughly 8,850 km from Jiayu Pass in the western desert to Shanhai Pass where it meets the sea, guarding the capital at Beijing through Juyong Pass. The small points trace the surveyed fortified passes along its length. Notice how tightly the wall now hugs the empire’s northern edge - this is a defensive dynasty drawing a hard line against the steppe, exactly the line whose precise coordinates survive today.

plot_period(periods_by_key$ming)

Qing - the wall swallowed by the empire (1644-1912 CE)

The irony closes the story. The Manchus - a northern people from beyond the wall - broke through in 1644 and founded the Qing, then expanded to the greatest extent of any Chinese empire, absorbing Mongolia, Xinjiang, Tibet and Manchuria. The Great Wall, so recently the hard edge of the Ming world, now ran straight through the interior of the Qing realm, with the empire’s heartlands on both sides. A border wall is only as meaningful as the border; once the steppe itself was Chinese territory the wall became a monument rather than a defence. The same Ming line is drawn here, coloured but now landlocked inside the map’s vast single domain.

plot_period(periods_by_key$qing)

The periods at a glance

summary_table <- map_dfr(config$periods, function(period) {
  tibble::tibble(
    Period = period$title,
    Dates = period$era,
    `State(s) highlighted` = paste(period$highlight, collapse = ", "),
    `Wall on this map` = recode(period$wall,
      early = "Dashed reference (real walls ran further north)",
      context = "Dashed reference (walls neglected)",
      lost = "Dashed reference (frontier lands held by rivals)",
      featured = "Ming course, coloured, with passes",
      internal = "Ming course, coloured, now interior")
  )
})
knitr::kable(summary_table, caption = "The seven maps and how each treats the wall")
The seven maps and how each treats the wall
Period Dates State(s) highlighted Wall on this map
Warring States c. 475-221 BCE Zhou states Dashed reference (real walls ran further north)
Qin and Han Empire 221 BCE - 220 CE Han Dashed reference (real walls ran further north)
Tang Empire 618-907 CE Tang Empire Dashed reference (walls neglected)
Song and the divided north 960-1279 CE Song Empire, Liao, Xixia Dashed reference (frontier lands held by rivals)
Yuan (Mongol) Empire 1271-1368 CE Great Khanate Dashed reference (walls neglected)
Ming Empire 1368-1644 CE Ming Chinese Empire Ming course, coloured, with passes
Qing Empire 1644-1912 CE Manchu Empire Ming course, coloured, now interior

Notes and provenance

  • Territorial borders: aourednik/historical-basemaps (CC-BY-SA), snapshot years chosen inside each dynasty. Reconstructed borders are interpretations.
  • Ming Great Wall geometry: Adl3rAi/The-Great-Wall-of-China-geodata (270 survey segments dissolved and simplified to ~500 m; 503 passes, three labelled).
  • Modern coastline and borders: Natural Earth (geographic reference only).
  • Only the Ming wall has precise open coordinates. Qin, Han, Sui and other earlier or rebuilt walls followed different, generally more northerly courses described in the prose rather than drawn, to avoid implying a precision the data lacks.
  • All spatial assets were preprocessed once by prep.R into the files this notebook reads; the notebook itself holds only loading and plotting logic.
  • Retrieved June 2026.