How to Map Which Railroad Crossings Have Gates and Which Only Have Signs

On this page

Problem statement

Whether a railroad crossing has gates, flashing lights or only a crossbuck sign is recorded for every crossing in the FRA's inventory, but as counts of each device, not as a category. This page turns those counts into four classes for the 126,100 open public crossings at grade on the 29 October 2026 copy: gates, lights without gates, signs only, and nothing recorded. 43.9% have gates. Most crossings without them see few trains, and the share with gates runs from 7.5% in South Dakota to 72.5% in Florida.

Quick answer

Classify each crossing by the strongest device it has, then count:

print(pub.warning.value_counts().to_string())
print(f"gated share of public crossings: {(pub.warning == 'gates').mean():.1%}")
warning
gates               55343
signs only          52031
lights, no gates    15258
nothing recorded     3468
gated share of public crossings: 43.9%

55,343 public crossings have gates, 15,258 flashing lights or bells without gates, and 52,031 signs only. 3,468 record no device at all, which on a public road usually means the record is incomplete rather than that the crossing has nothing.

Horizontal bars of open public crossings by warning: gates 55,343, signs only 52,031, lights without gates 15,258, nothing recorded 3,468. Horizontal bars of open public crossings by warning: gates 55,343, signs only 52,031, lights without gates 15,258, nothing recorded 3,468.
Public crossings by their warning.

Sorting crossings by their warning

1. Counting the devices

for c in ["countroadwaygatearms", "countflashinglightpair", "numbercrossbuckassemblies"]:
    print(c, pub[c].isna().sum(), pub[c].describe()[["mean", "max"]].round(2).to_dict())
countroadwaygatearms 1003 {'mean': 0.95, 'max': 22.0}
countflashinglightpair 786 {'mean': 3.02, 'max': 75.0}
numbercrossbuckassemblies 3649 {'mean': 1.35, 'max': 28.0}

The device columns are counts, not flags. Missing values are few: 1,003 crossings have no gate count and 786 no flashing-light count, so filling them with zero, as the setup does, moves little. A crossing can have several gate arms (the maximum is 22, at a wide multi-track crossing), so test for more than zero rather than for one.

2. Gates where the trains are

pub["trains"] = pub[["totaldaylightthrutrains", "totalnighttimethrutrains", "totalswitchingtrains"]].sum(axis=1)
bands = pd.cut(pub.trains, [-1, 0, 2, 10, 30, 1000], labels=["none", "1-2", "3-10", "11-30", "over 30"])
print(pd.crosstab(bands, pub.warning, normalize="index").round(3).to_string())
warning  gates  lights, no gates  nothing recorded  signs only
trains                                                        
none     0.183             0.159             0.067       0.591
1-2      0.259             0.159             0.020       0.562
3-10     0.478             0.122             0.016       0.384
11-30    0.749             0.052             0.012       0.188
over 30  0.814             0.053             0.039       0.094

Gates follow the trains. At crossings with no train recorded, 18.3% have gates and 59.1% only signs. Above thirty trains a day, 81.4% have gates and 9.4% only signs. States put gates first where trains and traffic are heaviest, so the busy crossings left with signs only are worth a list of their own (the busiest crossings).

Stacked bars of warning by trains a day: gates at 18% of crossings with no trains rising to 81% above thirty a day, signs only falling from 59% to 9%. Stacked bars of warning by trains a day: gates at 18% of crossings with no trains rising to 81% above thirty a day, signs only falling from 59% to 9%.
Warning by trains a day.

3. By state

by_state = pub.groupby("statename").agg(crossings=("crossingid", "size"), gated=("warning", lambda w: (w == "gates").mean()))
by_state = by_state[by_state.crossings >= 500].sort_values("gated")
print(by_state.head(5).round(3).to_string())
print(by_state.tail(5).round(3).to_string())
               crossings  gated
statename                      
SOUTH DAKOTA        1874  0.075
MAINE                768  0.168
IDAHO               1167  0.180
NORTH DAKOTA        3290  0.197
WEST VIRGINIA       1346  0.203
           crossings  gated
statename                  
ARIZONA          688  0.637
TEXAS           9240  0.639
VIRGINIA        1818  0.656
NEW YORK        2668  0.685
FLORIDA         3630  0.725

Among the states with enough public crossings to compare, which the filter sets as crossings >= 500, South Dakota has gates at 7.5% of them, then Maine 16.8%, Idaho 18.0%, North Dakota 19.7% and West Virginia 20.3%: long rural lines with few trains on most branches. The most gated are Florida 72.5%, New York 68.5%, Virginia 65.6%, Texas 63.9% and Arizona 63.7%.

Mapping gated crossings by county

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. County boundaries are the Census Bureau's 2024 cartographic boundary file, public domain. The setup builds pub, the open public crossings at grade with their warning class.

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}")
Path("data/cb_2024_us_county_20m.zip").write_bytes(Z.read("cb_2024_us_county_20m.zip"))
xing = pd.read_csv(Z.open("fra-crossing-inventory-2026-10-29.csv"), dtype={"crossingid": str, "statecode": str, "countycode": str, "latitude": str, "longitude": str}, low_memory=False)
xing = xing.sort_values("revisiondate").drop_duplicates("crossingid", keep="last")   # ten ids appear twice
pub = xing[(xing.crossingclosed == "No") & (xing.crossingposition == "At Grade") & (xing.crossingtype == "Public")].copy()
NUM = ["countroadwaygatearms", "countflashinglightpair", "numberofbells", "numbercrossbuckassemblies", "numberstopsigns", "numberyieldsigns",
       "totaldaylightthrutrains", "totalnighttimethrutrains", "totalswitchingtrains"]
pub[NUM] = pub[NUM].apply(pd.to_numeric, errors="coerce")
d = pub[NUM].fillna(0)
pub["warning"] = np.select(
    [d.countroadwaygatearms > 0, (d.countflashinglightpair > 0) | (pub.highwaytrafficsignal == "Yes") | (d.numberofbells > 0),
     d.numbercrossbuckassemblies + d.numberstopsigns + d.numberyieldsigns > 0],
    ["gates", "lights, no gates", "signs only"], "nothing recorded")
print(f"open public crossings at grade: {len(pub):,}")
open public crossings at grade: 126,100

Example 1: share gated by county

counties = gpd.read_file("data/cb_2024_us_county_20m.zip")
share = pub.groupby("countycode").agg(crossings=("crossingid", "size"), gated=("warning", lambda w: (w == "gates").mean()))
m = counties.merge(share, left_on="GEOID", right_index=True)
print(f"counties with a public crossing: {len(m):,}; matched {share.index.isin(counties.GEOID).mean():.1%} of county codes")
print(m[m.crossings >= 20].sort_values("gated")[["NAME", "STUSPS", "crossings", "gated"]].head(5).round(3).to_string(index=False))
counties with a public crossing: 2,674; matched 99.5% of county codes
    NAME STUSPS  crossings  gated
  Pawnee     KS         47    0.0
   Waldo     ME         44    0.0
Franklin     IN         25    0.0
Columbia     WA         23    0.0
     Gem     ID         26    0.0

The inventory's countycode is already the five-digit county GEOID, so it joins to the Census counties directly; 99.5% of the codes match. 2,674 counties have a public crossing. Among counties with at least 20, several have no gates at all, from Pawnee County, Kansas (47 crossings) to Gem County, Idaho (26). A county share is a ratio of small numbers in many places, so map it only where the count is large enough to mean something, and keep the count on the map (choropleth maps).

County map of the share of public crossings with gates, highest in California, Florida, Texas and the Northeast corridor and lowest across the northern Plains, the Mountain West and Maine. County map of the share of public crossings with gates, highest in California, Florida, Texas and the Northeast corridor and lowest across the northern Plains, the Mountain West and Maine.
Gated crossings by county.