Boston’s plans to harden its waterfront against the perils of climate change—storm surge, flooding, and sea level rise—seem like an all-around win. The only way to keep a higher, more turbulent Atlantic out of South Boston and Charlestown is to build parks, bike paths, gardens, and landscaped berms with waterfront views. These are all things that make a greener, more walkable, more livable city. If this is adaptation to a warmer world, bring it on.

Except geographers and community activists are getting more and more worried about how cities choose which improvements to build, and where. They’re noticing that when poorer neighborhoods get water-absorbing green space, storm-surge-proof seawalls, and elevated buildings, all of a sudden they aren’t so poor anymore. The people who lived there—who would’ve borne the brunt of whatever disasters a changing climate will bring—get pushed out in favor of new housing built to sell at or above market rates to people with enough money to buy not just safety but a beautiful new waterfront. In real estate lingo, “adaptations” are also “amenities,” and the pursuit of those amenities ends up displacing poor people and people of color. The phenomenon has a name: green gentrification.

Fighting climate disasters is a good idea for the planet, but can have unintended consequences for neighborhoods. “In order to construct a green, resilient park or shoreline, we get rid of lower-income housing … and behind it or next to it, you’ll have higher-income housing being built,” says Isabelle Anguelovski, an urban geographer at the Autonomous University of Barcelona who co-wrote an article about green gentrification in December’s PNAS. It can get even worse, she says. Hardening one neighborhood so that water can’t flow inland there means the water goes somewhere else. “The flooding and storm events go into the basements of the public housing next door,” she says.

That’s double jeopardy. And it turns into triple jeopardy, thanks to economics. New amenities plus new luxury housing drive up local housing prices, which drive out working-class and poorer residents. “The question is not only what Boston is facing, which is middle-class gentrifiers with a slightly higher income and education. It’s über-rich people who end up taking over cities until they are unable to fulfill their direct functions,” Anguelovski says. The gentrification wave is its own kind of economic apocalypse. If it hits, none of the people who make a city work—teachers, police officers, health care workers, bus drivers—can afford to live there. “Or it becomes so important from an economic standpoint, so desirable and hardened with infrastructure that entire buildings are empty—purchased by real estate funds or individuals from the Middle East or Russia,” Anguelovski says.

The problem that cities face is the difference between physics and real estate. Climate change happens on the scale of decades or centuries; real estate development and politics happen on fiscal and electoral timescales. “I get it. Green space is great, and while it may not be much of an improvement in terms of climate adaptation, it’s good for people’s well-being and quality of life,” says Ken Gould, an environmental sociologist at Brooklyn College and coauthor of Green Gentrification: Urban Sustainability and the Struggle for Environmental Justice. “Does it sequester much carbon? Not really. It’s fine. But you have to manage the real estate markets, because markets left to themselves, when you put in an amenity, are going to generate development.”

It’s not just Boston. In Philadelphia, Anguelovski and her team studied a program to build flood-fighting infrastructure like parkland, green roofs, and curbside swales to absorb rainwater before it hit sewers. This, too, was an engine of gentrification. “What you see on the maps is that the areas that gained the greatest amount of green resilient infrastructure are also those that became the most gentrified,” Anguelovski says. “And the areas that blacks and Latinos have had to move to between 2000 and 2016 have been the areas that got the least infrastructure.” In Brooklyn’s diverse Sunset Park neighborhood, residents and interest groups are arguing over a rezoning proposal that’d be favorable to green businesses and harden the waterfront. They fear it’d also force out the ethnically diverse, working-class group of people who live there.