City trees lead difficult lives. A lot of things are trying to kill them, particularly the trees planted on sidewalks: Tightly compacted soil with high alkaline content makes it harder for them to absorb nutrients. Tiny plots of land admit very little rainwater. They’ve got dogs peeing on them, people dropping cigarette butts nearby, and cars belching pollution.

“We’re talking about trees that are very vulnerable,” says Navé Strauss, the head of street-tree planting for New York City. His team manages the planting of new trees on streets and public rights of way; there are more than 666,000 street trees in the city, and the team plants about 16,000 new ones annually. For decades, New York arborists have tended to prefer “tough,” hardy species that thrive well against adversity—such as the London planetree, which sports grayish bark and big, maple-like leaves that offer sidewalks tons of shade.

But lately, Strauss has been looking for trees that can handle an even tougher challenge: climate change.

In the past century, the United States has heated up as much as 1.9 degrees Fahrenheit. The natural cycle of cities is already being pushed in new directions; in New York, spring now begins a week earlier than in the 1950s. Current predictions suggest that the temperature in the city will rise by up to 6 degrees by the 2050s, and up to 10 degrees by the 2080s. This hotter climate will bring longer periods of drought too. That will require some entirely new trees that can survive, and thrive, in the decades to come.

One stands out: “There’s this crazy tree out in Arizona, where it's highly, highly dry,” Strauss told me. A few of its relatives, the northern catalpa, have already migrated to New York and thrived, sporting huge leaves and flowers. “You’ll see them growing in vacant lots, where you’d be like—Where’s their food source?” he laughed. That’s why he thinks this new hybrid ought to be able to handle the coming droughts. So he pulled the trigger, and 10 of them went into the ground. Within a few years, Strauss and his team will know whether this tree will be a useful part of New York’s warmer, weirder climate.

Urban foresters think a lot about their cities’ distant future, because when you plant trees, you have to. A well-maintained tree in an urban park can last 150 years or longer. A sidewalk tree lives a shorter period, but it still might get 30 years or more. So a city arborist is always thinking: What’s this city going to be like 20 years from now? Or 50? Or 100? Trees are time machines, connecting us to the future.

American cities are host to 3.8 billion trees—on sidewalks, in parks, in our front yards and backyards, outside houses of worship and office complexes. They’re crucial for urban life: Most notably, trees cool down cities by creating shade and engaging in transpiration, the process by which they return water vapor into the atmosphere. Together, these effects can lower the temperature of a city street a few degrees (and as much as 10 degrees, as one recent study found). Studies have also found that well-placed trees can reduce air-conditioning costs by about one-third. Trees also remove up to 24 percent of dust; studies show that kids who live near urban trees have lower rates of asthma. Trees can even make pavement last a decade longer.

If cities want to keep those benefits, they’ve got to plan for a future with a different, more hostile climate. As cities heat up, they effectively become different places, where a species that has persisted for hundreds of years can no longer thrive. By some estimates, the habitable zones for 130 of the country’s tree species could move north by more than 400 miles by the end of the century. New invasive species will arrive. Unless cities continually adapt, these shifts could significantly erode their tree canopies, making urban landscapes uglier—and more unlivable.

If you wander around Louisville, Kentucky, you’ll find trees tucked in nooks all over—some dotting the downtown sidewalks, big clusters of mature ones along the snaky banks of the Ohio River, and even a few young trees adding a splash of green in front of the KFC Yum! Center sports complex.

But those trees are in danger. After an assessment of its urban forest in 2015, the local government discovered that the city was losing its canopy at a startling rate of 54,000 trees a year. The reasons for the decline are multifaceted, ranging from real-estate development to disease. The emerald ash borer, an invasive Asian beetle species that has been on a rampage across the United States, poses a particular problem. It destroys ash, a tree commonly planted in urban areas because of its good leaf cover and (normally) hardy nature. More than one in 10 trees in Jefferson County, where Louisville is located, are ash.

But on top of those problems, Louisville’s rate of heating is intense: Research by Brian Stone, the director of the Urban Climate Lab, discovered that Louisville had the fastest-growing urban heat-island effect of any other American city he and his team had studied.

“Big red flag, big red flag,” says Cindi Sullivan, a horticulturalist who used to work for the city and is now the executive director of TreesLouisville, a group that funds tree planting across the city. On top of regular climate warming, Louisville has the curse of geography; it’s in the Ohio Valley, and “the air will tend to kind of hang,” as Sullivan told me. “Unfortunately, that’s why we’re also called the allergy and asthma capital of the world.” Some of the city’s local climate change can likely be attributed to the loss of trees. Trees are, in effect, lo-fi geoengineering on an urban scale. Plant them, and things cool down; remove them, and things heat up.

So Louisville needs to plant more trees, and ones that are future-proofed. This means working with private citizens, because in Jefferson County, most of the trees aren’t on public land such as streets or parks. Fully 70 percent grow on private property, rooted in people’s yards. Rebuilding the canopy thus means making it as easy as possible for everyday citizens to plant a new tree; among other things, Sullivan’s group raises money to subsidize all this planting. It connects residents with software from the Arbor Day Foundation that lets a Louisville resident find the best place on their property to plant a tree that’ll provide maximum shade and energy savings.

But which species of tree will survive Louisville’s emerging climate? Lately, Sullivan’s group has been looking for trees that are native a bit farther south, such as Ulmus crassifolia, the cedar elm. It produces a big cloud of oval leaves, offering terrific shade, and it’s also good at dealing with drought.

And drought resistance is maybe even more important than heat resistance, if you want a tree that’s future-proof. Under climate change, city planners note, their precipitation is increasingly arriving in bursts; they get longer jags with less rain, followed by torrential downpours. When weather becomes spiky like that, a healthy urban canopy is even more crucial to have around, because trees help reduce the runoff that would otherwise overwhelm a city’s drain system. But the catch is finding a tree that can handle those erratic, feast-or-famine rainfall patterns. Crassifolia, Sullivan thinks, fits the bill for Louisville, and, as a bonus, it’s aesthetically interesting. “It’s a really cool tree,” she told me. “It has quirky bark, quirky stem—there are these ridges that fall all along the branches and stems.”

On a personal level, Sullivan also has high hopes for the zydeco twist, a species of black gum she planted at her own Louisville home nine years ago. The zydeco twist is originally from Louisiana, and Sullivan bubbled with excitement as she described it to me. “It has great fall colors—oh my gosh, it is fluorescent everything, all at the same time. It’s purple and it’s red and it’s yellow and it’s orange. I mean, it is amazing; it’s a beautiful tree!” She predicts that hers could survive another 50 to 90 years, well into maturity.

Sullivan’s sheer joy at her zydeco twist points to another reason cities need trees: They lift the human spirit. Trees don’t just keep the city cool and the air clean. They also have powerful aesthetic and psychological effects.

You can see it even in the numbers. People are more likely to walk down tree-laden streets, and they pay a premium of 6 to 9 percent for homes in neighborhoods with good tree cover. Sick people do better when surrounded by trees, too: One study found that patients recovering from surgery spent 8.5 percent less time in the hospital when they had a view of nature, compared with those who didn’t. Other research found that children with ADHD displayed better concentration after a 20-minute walk in a green park. Trees even appear, remarkably, to correlate with lower rates of crime: Academic research in 2001 discovered that apartments with abundant greenery experienced 52 percent less crime than those with less foliage.

Exactly why trees have such a powerful effect on us is not clear, though in the 1980s, the biologist Edward O. Wilson advanced the concept of biophilia, “an innately emotional affiliation of human beings to other living organisms.” We’ve co-evolved with trees, so maybe we have an emotional bond with them. Some scientists note that trees have self-replicating fractal patterns—the structure of a leaf resembles the structure of an entire tree—which may tickle human brains in ways that few other urban objects do.

“You start seeing, through biophilia, what the dappled shade does,” says Janette Monear, the head of the Texas Trees Foundation, a nonprofit that supports urban forestry in the state. “Your reptilian brain really connects to nature.”

I remember noticing this effect myself after Hurricane Sandy swept through Brooklyn, where I live, in 2012. It destroyed 319 trees in Prospect Park, a huge, 585-acre green space where some 30,000 trees grow. Of those trees that were killed, almost 50 were very mature—more than 150 years old, planted when the park was constructed in the 19th century. When I wandered through the park two days after the hurricane, local residents were standing in little clusters around the huge, toppled elms and oaks, and I saw a few people weeping. “I feel like someone has died,” one cleanup volunteer told the local radio station WNYC.

Sandy was “a big wake-up call to us to make sure that we’re considering planting trees that are going to be climate-adapted,” New York’s Navé Strauss told me. Kristen King, a colleague of Strauss’s, is the city’s director of natural-areas restoration and management, in charge of planting and maintaining New York’s parkland, which has about 2 million trees. King and Strauss know that climate change means more superstorms like Sandy. They’re easing back on planting trees that won’t thrive in the hotter, wilder weather to come, such as sugar maple (“they need that cold,” Strauss says) and northern red oak.

Increasing the diversity of trees is also crucial, King told me. In previous decades, the city had a fairly small range of trees, with only 40 different species. Now King oversees parks and forests with 180 species.

“If you have diversity, you have some built-in resilience,” she says. “If you lose one species, you don’t lose them all.” This is arguably what got cities in such trouble when they overplanted the ash in the 20th century, only to be sideswiped by the ash borer decades later. “Our work in forest management is to fight against monoculture,” King says.

“Trees don’t show you your results right away,” as Rob Davis told me. “You can build a new building, you can put new sod in, you can build new roads—but no matter how much money and power somebody has, they can’t put back 50-year-old trees.”

Davis, back when I spoke with him two years ago, was a forester for Denver, and he was making a crucial point about urban trees: They are the acme of civic planning. You want a street lined with mature, 50-year trees with tons of shade? Great! Even if you find the money and space to plant them, you need to wait half a century to see the fruits of your labor. Odds are you’ll be dead by then. This means that urban trees require serious forethought; they’re the opposite of what’s-in-it-for-me-right-now transactional politics.

The White House has abandoned serious climate planning, and federal climate legislation has also flagged. But some state and local governments have enacted effective climate action. Cities are more responsive, because they’re closer to where early climate problems are already being felt—including flooding coastal towns and sweltering inland ones. And city councils are a lot more accessible to activists too. When it comes to the urban canopy, everyday citizens have led the way: Some cities created an urban-forestry department after being urged by local nonprofit groups that had spent years doing volunteer work to aid green spaces; in others, urban-forestry departments rely on volunteer labor, such as “citizen pruners” (permitted to clear dead or hanging branches as they wander the town) and residents who walk around with clipboards doing tree censuses.

Thus far, Denver’s trees have survived the temperature increase of the 20th and early 21st centuries pretty well. Davis has seen pictures taken in the late 1800s showing American elm trees that still stand today. But Denver is now heating up in ways that longtime locals can notice too. “I’ve lived in Colorado all my life, and we used to play ice hockey on ponds here,” he noted. “Good luck playing ice hockey on a pond here anymore.”

Sara Davis, who worked as Denver’s urban-forestry program manager when I interviewed her in 2018 (she’s currently the city forester for Carmel-by-the-Sea, California), agreed. “We’re getting heavy, wet snow at the wrong time,” she said. “It was a couple of years ago that we had a huge storm on Mother’s Day. Everything was in leaf, and it was—how many inches of wet snow? Eight inches?”

So they, too, are focusing on trees that might survive the hotter, spottier weather in decades to come. Kentucky coffeetrees—with pointed oval leaves that cast a mountain of shade—will thrive, they suspect, because they handle drought easily and don’t seem much bothered yet by invasive species.

It might also be that, when it comes to trees, our urban future will borrow from our truly ancient past.

I asked Jenny Willoughby, the sustainability manager for Frederick, Maryland, how the city’s trees would fare in the hotter decades to come. She worried that one loser would be the sugar maple.

“We’re getting out of their range,” she said. Her phrasing reminded me that the language of cities and climate change can be odd. When you speak of a city going “out of range” for a tree, it makes it sound like the city is the thing that’s moving—as if it were an unmoored ship, floating away, pushed along by the tides of climate. Willoughby is also concerned about the fate of the eastern white pine, and the chestnut oak, which is already showing signs of distress.

When I asked her what trees might thrive, she brightened: “Ginkgo!” The ginkgo tree, as she noted, has a strange history. More than 200 million years ago, it was native to the landmass that became North America, back when the Earth was composed of one supercontinent, Pangaea. When continental drift broke Pangaea apart, the ginkgo vanished from North America. It thrived in Asia, though, where it became a common, hardy tree with large, fan-shaped leaves, and one famous for longevity—Japan and China have ginkgo trees that are more than 1,000 years old.

In 1784, William Hamilton, a wealthy botanical collector in Philadelphia, brought ginkgo trees back to the United States to plant on his property. The architect Frank Lloyd Wright loved them, and partly because of Wright’s influence, the ginkgo spread into cities across the country. It’s still an extremely hardy tree; two of those Hamilton originally planted were alive two centuries later. After hundreds of millions of years, the ginkgo had finally come back to America.

“It’s technically native,” Willoughby noted, so it thrives almost anywhere in the United States. But it doesn’t have any species that attack it, nor any that it attacks and crowds out, which makes it a useful addition to a city’s forests. “It’s a really weird conundrum. Ecologically, it exists outside of the whole web—it’s a living fossil. It really hasn’t changed over the years. And it really can survive cold and heat, and seems to be happy wherever you put it.” One of the trees that helps cities survive climate change may well be one that survived the dinosaurs.