This is the fourth article in a five-part series examining key urban challenges in American cities: Suburban sprawl | Gentrification | Big Data | Climate change | Diversity

When it comes to climate change, cities occupy the role of both hero and villain.

On the one hand, cities consume over two-thirds of global energy and are responsible for 37-49 percent of global greenhouse gas emissions. On the other, cities are also a key part of the solution. Even when it must happen without support at the federal level, cities are taking action on climate change.

Let's look at how cities and city-level administrations are battling against often-apathetic central governments in order to do their bit both to prevent global temperature rises and to build cities that are resilient to the worst effects of climate change.

The problem — vulnerable cities

As well as being home to most of the world's population, many are particularly vulnerable to the impacts of climate change.

Globally, cities like China's sprawling metropolis of Guangzhou on the Pearl Delta are at high risk from flooding and sea-level rise. In Jakarta, Indonesia, the city's sea walls are so overwhelmed that the government is taking desperate measures to spend over $40 billion on an ambitious bird-shaped "sea wall city."

Closer to home, Miami has been called the "ground zero" of climate change risk in the U.S. thanks to rising sea levels. Hurricane Sandy's visit in 2012 laid bare New York's vulnerability to storm surges, and Los Angeles' drought problems are set to intensify as water rights become one of California's most divisive political issues.

Mitigation and adaptation

So what can cities do? There are two ways to take action at the city level. The first is mitigation measures, which address the root causes. The second is adapation.

Rather than investing in "sea wall cities," mitigation means instead taking measures against groundwater extraction in sinking cities like Jakarta. Cities like Oslo, Norway, steal the headlines when it comes to mitigation, with its roll-out of electromobility and a radical "climate budget" that aims to count carbon dioxide the same way it counts money.

However, cities outside the West — such as Bogota and China's futuristic eco-cities are taking bold steps to become more sustainable and power themselves using renewable energy. As are U.S. cities like San Diego, whose mayor Kevin Faulconer aims to power his city by renewables by 2050.

Adaptation, on the other hand, accepts the reality of some degree of climate change and the rise of extreme weather and aims to make cities more "resilient" when it does happen. This is the logic behind Jakarta's new "sea wall city," as well as less sexy land use and zoning reforms for hazard mitigation.

Swimming against the tide

You may have noticed that nationalist governments are on the rise across the world. This means the prospects for progress on an issue of climate change which perhaps more than any other demands that citizens think and connect beyond the borders of their own country to find solutions looks bleak.

President Donald Trump famously called climate change a "hoax" and plans to gut the EPA one function at a time. While outright denialism is less palatable in Europe, the brand of "eco-nationalism" professed by the French, Hungarian and Danish right-wing parties is viewed with skepticism by environmentalists.

But all is not lost. As more powers are devolved to cities, they can be on the front line of this battle and are given more leverage over their reaction to the geographical reality.

The way that cities are governed will be crucial. Governance works not only vertically but also horizontally. Global urban networks such as the C40 and the 633 city-strong Compact of Mayors help to foster a sense of shared purpose and a forum for experience-sharing.

Nevertheless, questions remain over how efforts on the necessary scale will be funded. If U.S. cities are starved of federal funds for sustainability projects, even with the greatest political will they may not be able to act quickly enough. Reforms to building codes, for example, are crucial to make buildings more efficient and resilient, and that requires effective dialogue with central government.

However, what is most concerning is that experts say the "window of opportunity" for making meaningful progress may close by 2020. Past decisions mean that climate change is already "locked in," but the coming years will be crucial.

Innovating for more resilient cities

Tackling climate change need not hurt cities. Ultimately, forward-looking cities can make policy changes that simultaneously attract people to their cities for the quality of life and mobility options they offer, and also reduce emissions.

If there is one thing that is distinctive about cities throughout history, it is their capacity to adapt. The world's major cities host the best and most innovative minds. Thanks to growing urban networks, the world's wealthiest cities are also able to test and experiment on solutions that can then be implemented in less wealthy cities in order to both mitigate against and adapt to climate change.

Cities can be part of the solution as well as part of the problem.