Throwing oil on a train is much simpler than getting a new pipeline approved, though trains are more expensive. The challenge with crude-by-rail is that local and state governments fed up with the federal government's inaction can constrict crude exports, throwing a big wrench in North America's energy industry. A given intercontinental rail line runs through a number of states and local governments, creating many potential regulatory constrictions.

Just look at Albany, New York
Albany recently decided to derail Global Partners LP's (GLP 0.46%) plan to install heaters to help process thicker crudes. Now the company cannot proceed until a health impact study is completed. Some have gone further, calling for Global Partners' 2012 permit to be rejected and for an environmental impact study to be done. 

While this pushes back Global Partners' growth plan to be an integral part of the U.S. crude-by-rail business, its retail operations will stabilize its income. Global Partners has around 525 leased and owned gas stations along the eastern seaboard. Its gasoline distribution and station operations segment is a large part of its business, supplying 57.9% of its net product margin in Q3 2013. 

Many communities are unhappy with federal guidelines
The federal government recently tightened the regulations for transporting crude oil, but this decision affected less than 3% of all active oil tank cars. The thought of having another runaway oil train killing 47 people sends fear through the heart of small towns in affected areas, and limited federal regulations push communities to look for other ways to ensure their safety. 

What does this mean for investors?
Diversification is the name of the game. Given the ability for localities and states to enact their own regulations on the systems that support rail lines, oil producers and refiners need multiple ways to transport oil. 

Some bigger refiners like Tesoro (ANDV) have to worry about crude-by-rail regulations. Tesoro only has one small refinery in North Dakota. The majority of its refineries are along the Western Seaboard where pipeline capacity from the Midwest is hard to come by. Together Washington State and California account for 76.4% of Tesoro's 2013 refining capacity.

To help appease cities worried about Bakken crude Tesoro has already vowed to upgrade its entire rail car fleet to newer and safer designs by the middle of 2014. One of Tesoro's big projects is the 300 thousand barrel per day (mbpd) rail offloading facility in Vancouver. If opposition to the rail line were to constrict shipments, then Tesoro would be forced to use more expensive imported crude.

Northern Tier Energy LP (NYSE: NTI) is a great example of why diversification is important. The MLP's biggest asset is its single refinery. While it is close to major pipelines coming down from Canada, it carries a good deal of risk simply because of its lack of diversification. In September 2013 for example, a fire broke out, threatening Northern Tier Energy's entire production.

In 2013 its refining segment accounted for 95.3% of its EBITDA, making any plant issues especially impactful. Northern Tier Energy does own a few midstream assets, but they don't compensate for the MLP's lack of diversification.

Look for diversification and close proximity to producing formations
HollyFrontier (HFC) is a small refiner with just 443 mbpd of capacity, but it has a number of refineries strewn throughout the Midwest. In Texas it is inside the Permian basin while its refineries in Oklahoma and Kansas are close to the Mississippi Lime formation.

Being situated close to producing formations is great. It allows HollyFrontier to rely on small local pipelines to source its feedstock. Also, its Midwestern focus gives it good access to North America's midstream infrastructure for product exports. HollyFrontier's Woods Cross expansion with projected annual EBITDA generation of $125 million has already been designed to ship incremental production down to Las Vegas through a pipeline. 

HollyFrontier is still developing its rail assets, but the fact remains that it faces relatively few midstream challenges; it pulled in $73 million in 2013 cash distributions from its MLP Holly Energy Partners and its 2,900 miles of pipeline.

The Foolish bottom line
Crude-by-rail is an important part of midstream infrastructure, especially in light of pipeline constrictions. With that being said crude-by-rail is exposed to a host of regulatory challenges. Towns are aware that exploding oil trains are devastating. 

If more towns and states stall crude-by-rail expansions then oil refiners and producers will be hurt. By focusing on diversified refiners like HollyFrontier you can avoid some of the risk that comes with other refiners like Tesoro. Even Albany's recent decision to stall Global Partners LP's expansion plans is bearable as the company's big retail operations provide stability. Northern Tier Energy's recent refinery fire shows that relying on a single asset can be a very dangerous choice, and it is better to maintain a healthy level of diversity.