County Stripes


I was reading the comments on a time-lapse map of power outages in the US posted on Reddit yesterday. Many of the comments focused on the sizes of U.S. counties, particularly noting how counties appear to get noticeably larger as you travel westward across the country.

I therefore decided to take a closer look at the size of U.S. counties across the country, carrying out some spatial analysis using MapLibre GL JS and Turf.js.

My interactive map County Stripes allows you to explore county sizes in two ways:

  1. County Coloring Mode - each county is colored based on its individual land area.
  2. Longitude Band Mode - the map divides the country into vertical slices (longitude bands), calculates the average county size within each band, and colors the bands accordingly.

Understanding the Longitude Bands

U.S. counties vary dramatically in size from east to west. Eastern states have smaller, densely packed counties, while western states are characterized by large, sprawling counties.

To capture this pattern, I divided the country into longitude bands. For example, one band might span –112° to –110° longitude. Within each band, turf.js is used to calculate the average area of all counties whose centroids fall in that band. This allows the map to show how county sizes gradually change across the country, revealing the stark contrast between small eastern counties and large western counties.

By toggling to the Longitude Band Mode, users can see vertical bands colored according to these averages, making it immediately clear where counties are largest and smallest.

Calculating County Areas with Turf.js

The map uses Turf.js, a powerful geospatial analysis library for JavaScript, to calculate the land area of each county. The key function used is:

turf.area(feature)

This function accepts a GeoJSON Polygon representing a county and returns the area in square meters. We then convert the result to square miles for easier interpretation:

const areaSqMiles = turf.area(countyFeature) / 2_589_988.11;

Western counties are larger than those in the east largely due to history. Eastern counties were created when populations were dense, so smaller, more manageable divisions made sense. Western territories, were settled later and were originally sparsely populated, requiring much larger counties to cover these wide-spread less dense populations.

Comments

Popular Posts