Our mental snapshot of the politics of the Keystone XL pipeline is pretty straightforward - Republicans and most independents want it built; so do some Democrats, but most Democrats and the environmental left are opposed.

A new study in the journal Energy Policy, though, suggests that this assumption about pipeline politics mainly holds on the national level - but not so much locally. Rather, the research finds, as you get closer to the proposed pipeline route, liberals and conservatives living in those areas look less different in their views - and liberals as a whole are more in favor of the pipeline than liberals farther off.

The result suggests that anti-pipeline advocates may be losing the framing war to those who endlessly cite the pipeline's supposed economic benefits.

The research, conducted by Timothy Gravelle of the University of Essex and Erick Lachapelle of the University of Montreal, drew upon data from three large Pew Research Center polls of public views of Keystone XL, conducted in 2013 and 2014. The Pew data allowed the researchers to "geocode" each survey respondent according to his or her Zip code. Then, for each respondent, the minimum distance from his or her home to the proposed pipeline route was calculated.

You might think that people living in close proximity would be more worried about the pipeline, given both the continual focus on possible environmental consequences and the so-called NIMBY ("Not in My Back Yard") phenomenon. But the study found that locally, the issue was less partisan and that there was more Democratic or liberal support, in comparison with how those on the left feel about Keystone XL on a national level.

"Proximity to the pipeline leads to a greater likelihood of favoring the pipeline," the study reports. The result amounts to an "inverse NIMBY effect," the authors continue.

One possible reason, the researchers suggest, is that on the local level, the pipeline received much more media coverage, with more of a focus on costs and benefits alike for local communities. As a result, goes the thinking, people living near the proposed route were probably more highly exposed to a kind of cost-benefit trade-off - one that pits potential local jobs from building the pipeline (granted, the actual number that would be created has sometimes been overblown) against ecological consequences.

This, in turn, would have caused people to engage in more of an "on the one hand, on the other hand" way of thinking about the matter. "The promise of local jobs and other economic benefits work against environmental considerations of local spills and global risks related to climate change," they write.

This dynamic mostly mattered for liberals, not conservatives, the study found. In general, conservatives didn't waver much in their views of Keystone XL according to their proximity to the proposed pipeline route. It was only liberals whose views varied - such that "among American liberals the likelihood of favoring the pipeline decreases as distance to the pipeline increases," the study reports.

"As a result, there is no ideological divide as it relates to the Keystone XL near the proposed route; it is only at a substantial distance from the pipeline that differences between liberals and conservatives emerge," the authors continue.

None of which is to say that some people living along the pipeline's proposed route aren't opposed - they are. And some are even Republicans or conservatives, raising property rights concerns in the face of the need to build across land that they own.

It's just that, in the words of study co-author Lachapelle, "We wouldn't expect to find opposition to be concentrated locally. That's not to say you won't find local opposition and local protests, but the local here is not the centre of gravity for opposition."