How to Map Active Mines by County and Commodity
On this page
Problem statement
Where are America's working mines? A county map answers it, and the Mines file gives every mine a county code, but not one that joins: FIPS_CNTY_CD is the three-digit county part of a FIPS code, without the state, so "005" means a different county in every state. With the state's FIPS code put in front, 98.9% of active mines join to a county. This page builds the join, ranks counties by mines and employees, finds each county's main commodity, maps where coal is still mined, and lists the codes that do not match.
Quick answer
Prefix each mine's county code with its state's FIPS code and count active and intermittent mines per county:
counties = gpd.read_file("data/cb_2024_us_county_20m.zip")
act = mines[mines.CURRENT_MINE_STATUS.isin(["Active", "Intermittent"])].copy()
st_fips = gpd.read_file("data/cb_2024_us_state_20m.zip").set_index("STUSPS").STATEFP
act["GEOID"] = act.STATE.map(st_fips) + act.FIPS_CNTY_CD # FIPS_CNTY_CD is the county part only
per = act.groupby("GEOID").agg(mines=("MINE_ID", "size"), employees=("NO_EMPLOYEES", "sum"))
c = counties.merge(per, on="GEOID", how="left")
print(f"active mines: {len(act):,}; county codes that match a county: {act.GEOID.isin(counties.GEOID).mean():.1%}; counties with a mine: {c.mines.notna().sum():,} of {len(c):,}")
print(c.nlargest(6, "mines")[["NAMELSAD", "STUSPS", "mines", "employees"]].to_string(index=False))
active mines: 12,099; county codes that match a county: 98.9%; counties with a mine: 2,346 of 3,222
NAMELSAD STUSPS mines employees
St. Louis County MN 71.0 2954.0
Susquehanna County PA 63.0 242.0
Schuylkill County PA 55.0 634.0
Maricopa County AZ 55.0 555.0
York County ME 48.0 142.0
Williamson County TX 43.0 712.0
With the state prefix, 98.9% of the 12,099 working mines match a county, and 2,346 of the 3,222 counties have at least one. St. Louis County, Minnesota, home of the Mesabi Iron Range, leads with 71 mines and 2,954 employees, then Susquehanna and Schuylkill counties in Pennsylvania, Maricopa County, Arizona, York County, Maine, and Williamson County, Texas, near Austin.
Commodities, coal and density
1. By commodity
top = act.groupby(["GEOID", "PRIMARY_CANVASS"]).size().unstack(fill_value=0)
lead = top.idxmax(axis=1)
print(lead.value_counts().to_string())
SandAndGravel 1173
Stone 867
Nonmetal 188
Coal 91
Metal 36
In most mining counties the main commodity is aggregate: sand and gravel leads in 1,173 counties and stone in 867. Non-metal minerals lead in 188, coal in 91 and metals in 36. The map of mining is mostly a map of construction material, dug close to the towns that use it because it is too heavy to move far.
2. Where coal is mined
coal = act[act.PRIMARY_CANVASS == "Coal"]
print(coal.STATE.value_counts().head(6).to_string())
print(f"counties with an active coal mine: {coal.GEOID.nunique()}")
STATE
WV 179
PA 175
KY 77
VA 26
AL 17
IL 16
counties with an active coal mine: 124
Active coal mines are concentrated in Appalachia: West Virginia has 179 and Pennsylvania 175, Kentucky 77 and Virginia 26, then Alabama and Illinois. They are spread over 124 counties. The largest producers, the surface mines of Wyoming's Powder River Basin, are few and huge, which is why a count of coal mines and a sum of coal tonnage give different maps.
3. Per 1,000 kmΒ²
c["per_1000km2"] = c.mines / (c.to_crs(5070).area / 1e9)
print(c[c.mines >= 10].nlargest(5, "per_1000km2")[["NAMELSAD", "STUSPS", "mines", "per_1000km2"]].round(1).to_string(index=False))
NAMELSAD STUSPS mines per_1000km2
Susquehanna County PA 63.0 29.2
Schuylkill County PA 55.0 27.0
Northumberland County PA 29.0 23.2
Haskell County OK 36.0 22.7
La Crosse County WI 28.0 22.7
Among counties with at least 10 working mines, the densest are in Pennsylvania: Susquehanna County with 29.2 mines per 1,000 kmΒ², a bluestone quarrying area, Schuylkill County in the anthracite region with 27.0, and Northumberland. Haskell County, Oklahoma, and La Crosse County, Wisconsin, follow.
The codes that do not match
The data used on this page
The US Mine Safety and Health Administration's Open Government Data sets: the Mines file of every mine ever registered, annual employment and production by mine since 2000, and the accident reports from 2000 on (24 of their 57 columns, without the narratives), all as published on 23 October 2026, downloaded on 28 October 2026 and saved on this site, because MSHA replaces the files every week. Public domain. The files are pipe-delimited and Latin-1 encoded. County and state boundaries and county populations are the Census Bureau's 2024 files, public domain.
from pathlib import Path
import zipfile
import geopandas as gpd
import numpy as np
import pandas as pd
import requests
Path("data").mkdir(exist_ok=True)
# MSHA's Mines file, annual employment and production by mine since 2000 and accident reports since 2000 (24 columns,
# no narratives), all of 23 October 2026, with the Census Bureau's county estimates, counties and states. Saved
# 28 October 2026: MSHA replaces the files every week.
# Live: https://arlweb.msha.gov/OpenGovernmentData/DataSets/Mines.zip (and MinesProdYearly.zip, Accidents.zip)
ARCHIVE = "msha-mines-2026-10-28.zip"
if not Path(f"data/{ARCHIVE}").exists():
Path(f"data/{ARCHIVE}").write_bytes(requests.get(f"https://data.spatialworkflow.io/{ARCHIVE}", timeout=900).content)
Z = zipfile.ZipFile(f"data/{ARCHIVE}")
for f in ["cb_2024_us_county_20m.zip", "cb_2024_us_state_20m.zip"]:
Path(f"data/{f}").write_bytes(Z.read(f))
def read(name):
return pd.read_csv(Z.open(name), sep="|", encoding="latin-1", dtype=str, low_memory=False) # pipe-delimited, Latin-1, ids keep zeros
mines = read("Mines.txt")
for c in ["LATITUDE", "LONGITUDE", "NO_EMPLOYEES"]:
mines[c] = pd.to_numeric(mines[c], errors="coerce")
print(f"MSHA Mines file: {len(mines):,} mines; {mines.CURRENT_MINE_STATUS.value_counts().head(3).to_dict()}")
MSHA Mines file: 92,090 mines; {'Abandoned': 69608, 'Abandoned and Sealed': 8823, 'Active': 6667}
Example 1: the codes that do not match
bad = act[~act.GEOID.isin(counties.GEOID)]
print(f"unmatched: {len(bad)}; codes: {bad.GEOID.value_counts().head(5).to_dict()}; states: {bad.STATE.value_counts().head(4).to_dict()}")
unmatched: 134; codes: {'09005': 23, '09015': 21, '09011': 21, '09009': 14, '09003': 12}; states: {'CT': 107, 'AK': 8, 'MP': 8, 'AS': 5}
134 working mines do not match a county. 107 are in Connecticut, whose old county codes the 2024 boundaries replace with planning regions, and the rest in Alaska, the Northern Mariana Islands and American Samoa, where the codes differ from the boundary file's. Map Connecticut's codes to planning regions, or report the state as a whole.
Internal links
- County codes without their state β the join fixed here
- Quarries and pits β the commodity most counties have
- Coal production since 2000 β the coal counties' output
- Reading the Mines file β the columns