Canadian National Railway Company (TSX:CNR)(NYSE:CNI) shares are down nearly 5% year-to-date, and the explanation why is fairly simple—weakness in coal markets, crude oil markets, and grain markets have resulted in declining volumes shipped via rail.

A quick look at CN’s previous quarter reveals the impact of these weak markets on revenues—CN saw its coal revenues decline by 26% year over year, metals and minerals fall by 5%, and grain fall by 7%. With the outlook for many commodities being negative, does CN still have the ability to generate growth?

A closer look at the previous quarter reveals that the answer is yes. Despite the headwinds from declining volumes, CN’s net income actually increased year over year, and revenues were basically flat year over year. In addition, CN has confirmed that it is expecting double-digit earnings growth for 2015. The diversity of CN’s business is the major driver behind this growth.

CN has volume-growth opportunities in several of its key segments

In the previous quarter, CN saw carloads transported grow by about 6% in its intermodal segment and 8% in its automotive segment. CN’s forest products segments had a very small 1% decline in carloads.

These three segments comprise about 41% of revenue, and these segments are capable of growing volumes despite weakness in commodity markets. Starting with the forest products segment, CN currently has the highest exposure to forest products in the rail sector, and is the largest North American rail carrier of forest products.

This business is deeply linked to the U.S. housing sector and should see continued growth as the sector continues to recover. CN’s forest products business gives it direct leverage to the growing U.S. economy, and the recent news that U.S. unemployment has just reached a 7.5 year low will only contribute to the solid momentum in housing starts that the U.S. has been experiencing.

CN’s intermodal segment, CN’s largest segment as a percentage of revenue (at 23%), will also continue to see volume growth. CN’s intermodal segment is a large transporter of consumer goods to the U.S. economy. Like forest products, this segment also has exposure to the U.S. consumer, and should continue to benefit from a strengthening U.S. economy.

CN’s intermodal segment also has a large international component, which gives it exposure to Asian emerging markets. CN currently exclusively serves the Port of Prince Rupert, which is the closest North American port to Asia. Recently, large shipping company Maersk Line added a weekly service to Prince Rupert, and this should consume the ports remaining capacity.

In addition, the Port of Prince Rupert is currently in in the midst of a 500,000 20-foot equivalent unit (the size of a 20 foot shipping container) capacity expansion. Analysts estimate that this could add $350 million of revenue to CN over time.

While CN’s forest products and intermodal segments are poised for volume growth, CN also has plenty of opportunity in its automotive segment. CN currently has the only line that moves auto parts from the west coast to Detroit.

CN will also continue to benefit from pricing improvements

For CN, volume is only half the equation, and growth in pricing can help to offset weakness from volume or add to any volume increases. In the recent quarter, CN saw its overall carloads decline by about 3%. However, the company also saw its dollars per carload increase by 3%.

The end result was that despite an overall decline in volumes, CN was able to produce flat revenues and an increase in earnings thanks to cost-cutting measures. There were two basic forces that drove the increase in pricing—the first was favourable foreign exchange effects, and the second was solid increases in freight rates.

CN is forecasting strong annual rate increases of 3-4%, which is in excess of inflation. CN posted same-store price increases of 3.9% in the second quarter—at the high end of their target range—and it seems likely that CN will be able to continue raising prices in or above their target range, which will be a strong source of growth.

These increases will be possible thanks to the strong pricing power that railways enjoy due to limited competition and fairly tight transportation capacity.

While pricing and volume increases should lead to earnings growth, CN shareholders will also see better total returns thanks to the company's expected double-digit dividend growth. If you are interested in more companies with strong and sustainable dividend growth, we've prepared a report outlining some of Canada's best dividend opportunities

Check out our three top dividend stocks

These three top stocks have delivered dividends for shareholders for decades (and even centuries!). Check out our special FREE report: "3 Dividend Stocks to Buy and Hold Forever". Click here now to get the full story!

NEW! This Stock Could Be Like Buying Amazon In 1997

For only the 5th time in over 14 years, Motley Fool co-founder David Gardner just issued a Buy Recommendation on this recent Canadian IPO.

Stock Advisor Canada’s Chief Investment Adviser, Iain Butler, also recommended this company back in March – and it’s already up a whopping 57%!

Enter your email address below to claim your copy of this brand new report, “Breakthrough IPO Receives Rare Endorsement.”

Fool contributor Adam Mancini has no position in any stocks mentioned. David Gardner owns shares of Canadian National Railway. The Motley Fool owns shares of Canadian National Railway. Canadian National Railway is a recommendation of Stock Advisor Canada.