Repairman Shawn Flett stood 30 feet above the ground on the deck of a truck the size of a house. He had just waved it gingerly into the repair shop as if guiding an airplane into a hangar.

This is a beast of a machine, with 14-foot tires and weighing in at more than a million pounds. The truck burns 50 gallons of diesel an hour as it rumbles with 400-ton loads across the giant open-pit mines that have transformed a swath of Alberta’s vast northern forest into unsightly but lucrative sources of oil.

“It handles like a Cadillac,” Flett joked.

Every day, fleets of these Brobdingnagian trucks are digging up countless tons of Alberta’s oil sands — a black, gooey mixture of sand, oil and water that lies just below the Canadian province’s boreal forest, an immense region thick with jack pines, spruce, aspen and tamarack trees and fed by wetlands that cover most of the area.

The viscous petroleum, or bitumen, is so common that, in some places, it oozes out along the banks of the Athabasca River and was used by Native Americans to seal canoes. Canada’s economically recoverable oil sands are estimated to be about 170 billion barrels, reserves second in size only to Saudi Arabia.

The Canadian Association of Petroleum Producers estimates that production, now 1.7 million barrels a day, could nearly double by 2020, enough to supply nearly 20 percent of U.S. oil consumption. With that, the oil sands would be producing more than Venezuela, Nigeria, Iraq or Kuwait.

The rush to expand has been fueled by high oil prices, which for the past six years have held above the $50 threshold needed to make the oil sands projects profitable, and has turned this northern Alberta outpost into a bustling boomtown.

This expansion is the reason TransCanada proposed building the Keystone XL pipeline, a 1,700-mile line that would add a link between Alberta and the hungry oil refineries on the Texas coast of the Gulf of Mexico.

The pipeline has become a powerful symbol and political pawn this election year. It is also a sort of Rorschach test of how Americans view energy issues: Are we energy rich or energy poor? How do energy policies affect job creation, tax revenue and U.S. manufacturing competitiveness? How pressing are ­climate-change concerns, and how do we balance them with economic priorities?

The American public is firmly behind the pipeline, seeing plenty of upside in potential jobs and limited environmental downside. A new Washington Post poll finds nearly six in 10 saying the U.S. government should approve the project. Its wide acceptance is rooted in the fact that 83 percent think it will create jobs. Nearly half think it will not cause significant damage to the environment.

The oil industry and many national security experts think that importing more oil from Canada, a stable neighbor and ally, will make the United States more secure, and they worry that, without the Keystone XL, Canada will send that oil to China.

But the process of extracting oil from the sands, also called tar sands, has alarmed people worried about climate change.

Unlike oil that spurts up from reservoirs in most of the world, including Saudi Arabia, half of Canada’s oil sands are dredged up in a process more akin to strip mining. Trees are cut, layers of wetland fen and peat are drained and peeled back, and then the companies dig into a rich layer of oil sands that go down nearly 400 feet. In areas to the south where the gunky oil lies even deeper, companies are drilling wells, generating and injecting steam into the ground to melt the bitumen, and then sucking it up to the surface.

Using energy to get energy

All of this is extremely energy intensive. Companies expend energy equal to one barrel of oil to extract four to eight barrels from the oil sands.

More energy expended means more greenhouse gases. A Congressional Research Service report released May 15 estimated that Canada’s oil sands produced 14 to 20 percent more greenhouse gas emissions than the average barrel of U.S. imported crude oil — or comparable to low-quality Venezuelan crudes.

By other standards, however, oil sands look worse. The “well to tank” emissions (those created just to get the gas to the car) of Canadian oil sands are about twice as high as the average U.S. crude import.

In addition, stripping the wetlands of peat and fen — which naturally store carbon dioxide — compounds the problem, said Jennifer Grant, oil sands director at the Pembina Institute, a Calgary-based environmentally oriented think tank.

That’s why foes of the Keystone XL have turned the pipeline, just one of many built or expanded every year, into a test of President Obama’s commitment to slowing climate change.

“The projects themselves are enormous and ugly — but even uglier is the freight of carbon they contain,” said Bill McKibben, a Middlebury College professor who has been a leading voice against the pipeline. “That’s the second-largest pool of carbon on Earth. . . . No one who is serious about fighting climate change can want to see that oil out of the ground and into the air.”

The oil sands will be needed even if people use oil more efficiently, said John Abbott, executive vice president for heavy oil at Shell Canada. World population growth and improving living standards in developing countries will soon double global oil demand.

“All forms of energy have an impact, and it’s Shell’s role to ensure that whatever form of energy it generates is done in the most environmentally acceptable manner that the industry knows how to do,” Abbott said. “Once we get to that point, you cannot expect any more from an industry.”

This year, Shell and its partners will decide whether to go ahead with a project that would capture and bury carbon dioxide emissions from a plant near Edmonton that upgrades the quality of tar sands oil. Alberta and the federal government have agreed to put in $865 million, more than half the cost over the first decade. Shell would bury about a million tons of carbon dioxide a year, bringing the greenhouse gas profile of its oil sands close to parity with other U.S. imports, Shell said. Overall, however, the oil sands industry emits more than 30 million tons of carbon dioxide a year and will emit more as it expands.

“The big question is how do we reconcile oil sands growth with the fact that we’re entering a carbon-constrained future,” Grant said.

The oil sands emissions are pushing Canada over its internationally agreed-upon greenhouse gas targets, but Travis Davies of the Canadian Association of Petroleum Producers says they make up 0.1 percent of global emissions and shouldn’t be singled out.

Evaluating the environment

Many Canadians are angry that environmental groups have targeted the oil sands industry.

At the Tavern in Fort McMurray, a poster just inside the door says: “Conflict Oil” with a photo of Venezuelan President Hugo Chavez. Beneath him, it says “forced labor.” Under “Ethical oil” is a smiling, clean-cut guy in a hard hat. Below him, it reads: “Good jobs.” A best-selling book called “Ethical Oil” argues that tapping the oil sands is ethically preferable to helping the economies of Saudi Arabia or Venezuela, countries that lack many human rights.

Canada’s public safety ministry raised a ruckus in February when it listed environmentalism and its “grievances, real or imagined,” as a cause that could inspire terrorism.

“Do we have challenges? Yes,” said Brad Bellows, spokesman for MEG Energy. But he said much of the criticism of oil sands development was “political, misleading or downright wrong.”

To many Canadians, the oil sands development takes a modest bite of land in a province two-thirds bigger than California. From a helicopter, the mammoth trucks look like toys and the forest stretches north as far as the eye can see.

But to some, the oil sands development is still huge and ugly and raises environmental issues that include the effects on caribou, the loss of wetlands and the giant “tailings ponds” used to store mining waste.

“I had an uncle who lived in New Jersey, and I used to go visit. It crossed my mind recently that maybe that was their model of what the oil sands would look like: 1960s New Jersey,” said David Schindler, a professor of ecology at the University of Alberta who has studied water in the oil sands area since the 1970s and has pressed for tighter regulations.

The process of extracting the bitumen hasn’t changed since it was patented in the 1920s by a University of Alberta scientist, Karl Clark. Essentially, the oil sands are mixed with warm water. The sand sinks to the bottom, the water and suspended clay sit in the middle and the oil floats on top.

It’s the scale of the operation that’s daunting. Syncrude, a joint venture of half a dozen companies that includes China’s Sinopec and Arkansas-based Murphy Oil, is one of the biggest oil sands producers. From the air, its plant, which partially refines the viscous oil, juts up along the Athabasca River. Piles of sulfur the size of giant warehouses sit in the open. Clouds of dust kicked up by the big trucks float over the land. Across the river, deep gashes have been cut in a cleared field to drain the water from wetlands that will be stripped away.

Shell’s Jackpine and Muskeg mines are up Highway 63 — often called the world’s biggest cul-de-sac, it comes to a dead end at the northern-most oil sands projects. Across the Athabasca River, the forest parts to reveal open fields where Shell, which is expanding its operations, has started peeling back the top layer of soil to be stored in large mounds for reclamation. There is an airport big enough for jets to land with supplies and dorms for 2,500 workers.

From a black sandy ridge nearby, one can peer into the Jackpine mine. About 15 of the monster-size trucks lug the black sands to conveyer belts that feed into a series of processing facilities, which mix the sands with water, skim off the oil and spit what’s left over — known as tailings — into dark “ponds.” The tailings contain water, fine silts, bitumen, toxic napthic acid and solvents. Ditches outside the berms collect water and pump it back into the ponds.

The payoff: For every 400-ton truckload of oil sands, the companies get 200 barrels of oil. With crude oil selling for $80 to $100 a barrel, that’s very profitable.

Shell does internal evaluations of project economic viability using a hypothetical carbon emissions price of $40 a ton for carbon dioxide, even though at the moment there is no carbon tax or cap-and-trade program imposing such a fee. But the $40 price is well above prices on Europe’s existing carbon exchange, and the oil sands still pass financial muster, Abbott said.

Moreover, most energy companies spend vast sums exploring for reservoirs. They’re spared that expense here. The tar sands are oil rich and everywhere. There’s no such thing as drilling a dry hole.

And Canada is a stable democratic country. The life of an oil sands project could be 40 or 50 years, much longer than the life of a Gulf of Mexico well. Not counting capital costs, which are huge, operating costs are in the range of $35 to $40 a barrel, Abbott said.

Looking ahead

In the future, more of the oil sands will be extracted with the technique of injecting steam into the earth. The advantages: It doesn’t leave the same gaping holes and there aren’t any tailings ponds. The helicopter pilot summed it up: “Steam goes down, money comes up.” It is also the way to reach deeper, below 400 feet, where most of the oil sands lie.

But the “steam-assisted gravity drainage” method, as it is known, still involves drilling pads, pipelines, power plants to generate steam and facilities for separating the oil and storing some of it.

Schindler says it isn’t clear whether the steam injection process will contaminate deep saline aquifers, which feed rivers.

“It’s a big peat land, so it’s like having a big sponge slowly seeping water into the rivers,” he said.

And the long lanes cut in the forest for power lines, pipelines and railroads as well as the noise of machinery could drive away caribou, Schindler said.

Can the companies clean up when they’re finished here?

The reclaimed areas won’t be as flat for one thing; the ground, now less compact, will be higher, which means fewer wetlands. Moreover, the Pembina Institute says only 1 percent of the tailings ponds have been replanted. Even if land can be reclaimed, a costly undertaking, the greenhouse gases will be long gone into the atmosphere.

Cheryl Robb, a Syncrude media relations person, stopped her pickup at an area the company has reclaimed.

A field of young trees — jack pines, aspen, spruce — was springing up above an idyllic pond. Small cannons sounded just over the hill to scare off birds that would die if they landed on the oily surface of tailings ponds. Trucks and buses barreling down Highway 63 were audible. Beyond the hill, the stacks and pipes of a processing facility loomed in the distance.