BANFF, Alta. -- Giving grizzlies better travel paths and sightlines along rail lines is the best way to keep the bears safe from trains, a five-year study has concluded.

"We're actively going to be more involved in creating more trails for bears to be able to move past impediments on the railroad," Rick Kubian, a Parks Canada superintendent for Lake Louise, Yoho and Kootenay national parks, said Wednesday.

"Those pinch points on the landscape where bears are forced to the railroad, we're looking at a few locations where we might be able to provide alternatives for bears so they don't have to travel that corridor."

Between 2010 and 2015, at least 11 grizzly bears at any one time were being tracked with radio collars to find out where, when and sometimes why they were using the railway.

The study, funded by CP and Parks Canada, found that enough grain is spilled along the tracks to fill about 1 1/2 hopper cars a year. That's enough to feed about 50 bears, said Colleen Cassidy St. Clair, the University of Alberta biologist who directed the study.

"In bear terms, that's significant," she said.

But she added that the grain isn't as big a problem as previously thought.

"We also found out that grain is far from the only attractant on the rail and it may not be the most important one."

Bears also munch on plants such as buffalo berries, many of which do well in the cleared, sunny stretches along a rail line.

"They're more abundant there, they're more productive there and they mature earlier there."

St. Clair said railroad grades also connect different patches of good bear grazing.

She suggested that one way to protect bears along the rail grade is to make sure they can see what's coming down the line.

"It's more likely the bears that are the most vulnerable are the ones that do not detect oncoming trains soon enough to avoid a panicked and ineffectual reaction."

Bears that look up too late take the path of least resistance as an escape route, St. Clair said. That may mean the rail line itself.

In addition to travel paths, Parks Canada will use prescribed burns to create more areas of good bear grazing, said Kubian.

CP will spend $750,000 over three years to trim vegetation the bears like and open escape paths for them where trees and bush now block the way, said Joe van Humbeck, environmental assessment manager. The company will also use electromats and fences around railroad lubrication stations, where bears sometimes enjoy a good lick of grease.

"We will be working closely with Parks Canada this spring to identify the priority areas," said van Humbeck.

Both CP and Parks Canada are experimenting with flashing lights and sounding alarms in areas that bears are likely to use to give them more warning of approaching trains. A device is being tested in four locations.

"We are waiting to see the results. The initial indications are quite positive," van Humbeck said.

The study began in 2010 after bear deaths along the CP line through Banff National Park grew to account for nearly one-third of all bear deaths in the park. Van Humbeck said there hasn't been a confirmed grizzly death along the railroad since 2012.