How to Read FRA's Highway-Rail Crossing Inventory in Python

On this page

Problem statement

The FRA's crossing inventory reads into pandas in one line. Using it takes more care. The 438,910 rows include crossings that closed decades ago and bridges where the road and the railroad never meet. Ten crossing ids appear twice. The county code is a five-character text that turns into a number unless you stop it. The latitude and longitude columns hold strings with degree signs and stray quote marks. This page reads the 29 October 2026 copy as text, checks each of those columns, keeps the latest record of each open crossing at grade, and builds a GeoDataFrame of the 202,564 crossings with usable positions.

Quick answer

Read every column as text, then look at the first rows and at how the records divide between open and closed, and at grade or not:

print(xing[["crossingid", "railroadcode", "statename", "countyname", "crossingtype", "crossingposition", "crossingclosed"]].head(3).to_string(index=False))
print(xing.groupby(["crossingclosed", "crossingposition"]).size().to_string())
crossingid railroadcode    statename countyname crossingtype crossingposition crossingclosed
   000000A          BLE PENNSYLVANIA       ERIE      Private          RR Over            Yes
   000100E           AA         OHIO      LUCAS       Public         At Grade            Yes
   000101L           AA         OHIO      LUCAS       Public         At Grade            Yes
crossingclosed  crossingposition
No              At Grade            203158
                RR Over              18240
                RR Under             21369
Yes             At Grade            182952
                RR Over               6585
                RR Under              6606

Of the 438,910 records, 203,158 are open crossings at grade, where a road meets the track on the level. At 18,240 open crossings the railroad passes over the road and at 21,369 under it; the rest are closed. Most analyses want the first group only, so filter on both crossingclosed and crossingposition before counting anything.

Horizontal bars of crossing inventory records: 203,158 open at grade, 21,369 open with the railroad under the road, 18,240 over it, 182,952 closed at grade, and a few thousand closed bridges. Horizontal bars of crossing inventory records: 203,158 open at grade, 21,369 open with the railroad under the road, 18,240 over it, 182,952 closed at grade, and a few thousand closed bridges.
The inventory's records by status and position.

Reading the inventory's columns

1. One row per crossing, nearly

print(f"rows: {len(xing):,}; distinct crossing ids: {xing.crossingid.nunique():,}")
print(f"ids of six digits and a letter: {xing.crossingid.str.fullmatch(r'[0-9]{6}[A-Z]').sum():,}")
twice = xing[xing.crossingid.duplicated(keep=False)].sort_values(["crossingid", "revisiondate"])
print(twice[["crossingid", "revisiondate", "reasondescription", "crossingclosed"]].head(4).to_string(index=False))
rows: 438,910; distinct crossing ids: 438,900
ids of six digits and a letter: 438,910
crossingid            revisiondate reasondescription crossingclosed
   022128G 2026-05-28T00:00:00.000    Change in Data             No
   022128G 2026-05-28T00:00:00.000    Change in Data             No
   102639N 2025-01-14T00:00:00.000    Change in Data             No
   102639N 2025-07-15T00:00:00.000    Change in Data             No

Ten ids out of 438,910 appear twice. Some pairs are two copies of the same revision, like 022128G. Others are two revisions of one crossing, like 102639N, revised in January and again in July 2025. In both cases, sort by revisiondate and keep the last row per id before joining anything to the inventory. Every id has the inventory's shape, six digits and a check letter, so the id column itself needs no cleaning (collisions that do not join are another matter).

2. Codes kept as text

print(xing[["statecode", "countycode"]].head(3).to_string(index=False))
print(f"county codes of five characters: {xing.countycode.str.len().eq(5).mean():.1%}")
statecode countycode
       42      42049
       39      39095
       39      39095
county codes of five characters: 100.0%

statecode is the two-digit state FIPS code. countycode already carries the state in front: Erie County, Pennsylvania is 42049, not 049. That makes it a ready county GEOID, but only while it stays text. Read as a number, 06037 (Los Angeles) would become 6037 and stop matching the Census Bureau's files (leading zeros in census joins).

3. Numbers that arrive as text

for c in ["latitude", "longitude"]:
    v = pd.to_numeric(xing[c], errors="coerce")
    print(c, "missing:", f"{xing[c].isna().sum():,}", "not a number:", xing[c][v.isna() & xing[c].notna()].tolist())
year = pd.to_numeric(xing.annualaveragedailytrafficyear, errors="coerce")
print("traffic count years outside 1950-2026:", year[(year < 1950) | (year > 2026)].value_counts().sort_index().to_dict())
latitude missing: 76,560 not a number: ["47.836319''''", "47.838013''''", '29.307720Β°', '29.309727Β°', '32.071635Β°']
longitude missing: 76,559 not a number: ['-94.796982Β°', '-94.791500Β°', '-81.059356Β°']
traffic count years outside 1950-2026: {0.0: 16, 1.0: 1, 201.0: 1, 910.0: 1, 988.0: 1, 1000.0: 2, 1016.0: 1, 1017.0: 1, 1018.0: 1, 1068.0: 1, 1085.0: 1, 1111.0: 1, 1300.0: 1, 1800.0: 5, 1842.0: 1, 1900.0: 228, 1908.0: 4, 1943.0: 1, 2028.0: 1, 2030.0: 1, 2035.0: 1, 2060.0: 2, 2070.0: 1, 2071.0: 1, 2090.0: 1, 2096.0: 1, 2107.0: 1, 2108.0: 3, 2109.0: 1, 2130.0: 1, 2158.0: 1, 2201.0: 1, 2202.0: 1, 2229.0: 1, 2271.0: 1, 2780.0: 1, 2918.0: 2, 2999.0: 3, 3028.0: 1, 4122.0: 1, 4854.0: 1, 5000.0: 1, 5400.0: 1, 5475.0: 1, 5969.0: 1, 6000.0: 1, 8195.0: 1, 8796.0: 1, 9800.0: 1, 9999.0: 4}

Latitude is missing on 76,560 rows, mostly closed crossings. Where it is present, a few values are not numbers: two with a run of apostrophes, 47.836319'''', and three with a degree sign. pd.to_numeric without errors="coerce" stops at the first of them. The year of the traffic count holds 228 rows of 1900, 16 of 0 and 4 of 9999, none of them a year anyone counted traffic in. Treat a count dated outside a plausible range as undated.

Map of open highway-rail crossings at grade in the lower 48, public crossings in dark blue tracing every rail line and private ones in orange along rural lines in the Plains and the West. Map of open highway-rail crossings at grade in the lower 48, public crossings in dark blue tracing every rail line and private ones in orange along rural lines in the Plains and the West.
Open crossings at grade, public and private.

4. Points

latest = xing.sort_values("revisiondate").drop_duplicates("crossingid", keep="last")
open_ = latest[(latest.crossingclosed == "No") & (latest.crossingposition == "At Grade")].copy()
for c in ["latitude", "longitude"]:
    open_[c] = pd.to_numeric(open_[c].str.strip("'Β°"))
ok = open_.latitude.between(13, 72) & open_.longitude.between(-180, -64)
g = gpd.GeoDataFrame(open_[ok], geometry=gpd.points_from_xy(open_[ok].longitude, open_[ok].latitude), crs=4326)
print(f"open at-grade crossings: {len(open_):,}; with usable coordinates: {len(g):,}")
print(open_.latlongsource.value_counts(dropna=False).to_dict())
open at-grade crossings: 203,152; with usable coordinates: 202,564
{'Actual': 175752, 'Estimated': 18393, nan: 9007}

Keeping the latest record of each crossing and the open, at-grade ones leaves 203,152 crossings. After the stray characters are stripped, 202,564 of them have a position inside the range of US crossings. 175,752 positions are marked Actual, 18,393 Estimated and 9,007 carry no source. Estimated positions are good enough for a county map, but not for measuring which side of a road a crossing is on (impossible coordinates are fixed on their own page).

Crossings by state and by railroad

The data used on this page

The Federal Railroad Administration (FRA) publishes the Highway-Rail Crossing Inventory (Form 71, one current record for every crossing that is or was in use) and the highway-rail grade crossing incident reports (Form 57, every collision a railroad has reported since 1975) on the Department of Transportation's open data portal. The copies used here were downloaded on 29 October 2026 and saved on this site, because both tables are updated every day; they keep the columns these pages use and leave out the narratives and the contact telephone numbers. Public domain. The setup reads every column as text, as the steps above do.

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)
# Federal Railroad Administration: the Highway-Rail Crossing Inventory (Form 71, the current record of every crossing,
# 47 of its 265 columns) and the highway-rail grade crossing incident reports (Form 57, 1975 on, 51 of 154 columns,
# without the narrative), with the Census Bureau's 2024 county estimates, counties and states.
# Saved 29 October 2026: both tables change every day.
# Live: https://data.transportation.gov/resource/m2f8-22s6.csv and https://data.transportation.gov/resource/7wn6-i5b9.csv
ARCHIVE = "fra-crossings-2026-10-29.zip"
if not Path(f"data/{ARCHIVE}").exists():
    Path(f"data/{ARCHIVE}").write_bytes(requests.get(f"https://data.spatialworkflow.io/{ARCHIVE}", timeout=600).content)
Z = zipfile.ZipFile(f"data/{ARCHIVE}")
xing = pd.read_csv(Z.open("fra-crossing-inventory-2026-10-29.csv"), dtype=str)
print(f"crossing records: {len(xing):,}; columns: {xing.shape[1]}")
crossing records: 438,910; columns: 47

Example 1: open crossings by state

print(open_.statename.value_counts().head(8).to_string())
statename
TEXAS         14040
ILLINOIS      11282
OHIO           8559
CALIFORNIA     8434
INDIANA        7500
GEORGIA        7234
KANSAS         7176
MICHIGAN       6718

Texas has the most open crossings at grade, 14,040, then Illinois with 11,282, Ohio, California and Indiana. This is the denominator for any crossing rate in a state (collisions per crossing by state).

Horizontal bars of open crossings at grade by state: Texas 14,040, Illinois 11,282, Ohio 8,559, California 8,434, Indiana 7,500, then Georgia, Kansas and Michigan. Horizontal bars of open crossings at grade by state: Texas 14,040, Illinois 11,282, Ohio 8,559, California 8,434, Indiana 7,500, then Georgia, Kansas and Michigan.
Open crossings at grade by state.

Example 2: open crossings by railroad

print(open_.railroadname.value_counts().head(6).to_string())
print(open_.reporting_railroad_class.value_counts().to_dict())
railroadname
Union Pacific Railroad Company          30008
BNSF Railway Company                    25703
Norfolk Southern Railway Company        23187
CSX Transportation                      22451
Kansas City Southern Railway Company     3560
Illinois Central Railroad Company        3071
{'Class I': 119051, 'Class III': 70771, 'Class II': 6209, 'Not Assigned': 5447, 'Unassigned': 1674}

The four largest freight railroads report most of the open crossings: Union Pacific 30,008, BNSF 25,703, Norfolk Southern 23,187 and CSX 22,451. railroadname is the railroad that operates the crossing, so a crossing shared by two railroads is counted once, under one of them. By class, Class I railroads report 119,051 crossings and the short lines of Class III 70,771.