HARRISBURG, Pa. (WHTM) — Could a 2019 oil refinery explosion in Philadelphia be impacting gas prices more now than it did when it happened three years ago?

Yes, says a government economist. And the closer you are to the former Philadelphia Energy Solutions (PES) refinery — says Jeff Barron, an industry economist with the U.S. Energy Information Administration (EIA) — the more its absence matters.

“Pittsburgh can get access to alternative sources of supply” more easily than places farther east in Pennsylvania, Barron said.

Get daily news, weather, breaking news and alerts straight to your inbox! Sign up for the abc27 newsletters here.

“Ohio, for example, is a bit more in line with [historical prices],” Barron said. “I mean, it’s still obviously going to be affected by the same factors — the cost of crude oil, refining costs, all those.”

But it didn’t lose a giant oil refinery on top of all that. The PES facility was the oldest and largest refinery on the east coast.

Local per-gallon gasoline prices are a function of several factors. There’s “the price of the actual stuff they dig out of the ground, which is crude oil — that’s very high right now,” explained Jay Shabat, publisher of Econ Weekly.

But you can’t pump crude oil into a Honda Civic or Ford F-150.

“So when they actually turn the crude oil into the gasoline that you put in your car, that costs something, and that price is very high right now as well,” Shabat said.

That helps explain why average U.S. gasoline prices are (according to GasBuddy) within about a penny of their highest-ever levels (records just set in March) even though crude oil prices are not near their all-time highs: West Texas Intermediate (WTI) crude now trades for about $103 per barrel, down from $110 Friday and $125 in March, when the U.S. hit its all-time high of $4.35 per gallon. Back in July 2008, WTI crude touched $147 per barrel, but gasoline was “just” $4.10 per gallon.

Back then, the world was a financial mess but not as much of a logistical mess as it is now.

But as for why gas prices are now somewhat higher in eastern Pennsylvania than in western Pennsylvania? Which — yes — reverses a long-term trend that was evident as recently as a year ago:

That gets back to the refinery fire. If you remember the dramatic video, remember it was sad (five workers were hurt) but could have been worse (nobody died), but can’t remember gas prices surging because of it, your memory isn’t failing you. Gas prices didn’t surge because the world was logistically sound enough that other sources could meet the demand for gas.

Then the pandemic hit, and the world was a logistical mess, but demand for gasoline was so low that supply issues didn’t matter. Now the world is still a logistical mess, but “demand has returned back to more or less pre-pandemic levels,” Barron said — so everything matters.

“And that’s what’s helped contribute to these higher crack spreads, which ultimately do indeed feed to the retail gasoline market,” Barron said. (“Crack spread” is industry shorthand for refining margin, or how much refineries charge to turn crude oil into products like gasoline or jet fuel.)

“If you look at a map of the country, the middle of the country — it runs sort of along the spine, you know, basically Texas, up to North Dakota, Montana — that’s where you tend to see the cheapest gas prices,” said Shabat, the Econ Weekly publisher.

It’s also where you see refineries and pipelines most easily accessed, among cities in Pennsylvania, by Pittsburgh.

Even a complex world has some simple truths.

“Distribution matters a lot, and geography matters a lot,” Shabat said. “So if your gas station is right next to a refinery where they turn the crude oil into gas, then chances are the gas is going to be cheaper than if your gas station is located very far from a refinery.”