Scott Wiener, the California state senator representing San Francisco, has a pretty good idea for how to save the world. In fact, sitting in a coffee shop in his city’s Financial District, Wiener seems downright perplexed that anyone would be against it. Here’s the idea: Build more housing.

So, with his fellow senator Nancy Skinner, he authored a bill, SB 827, that overwrites some metropolitan zoning—putting policies that had been in the hands of cities under the authority of state government—to allow medium-sized multistory and multiunit buildings near transit stops.

Lots of urbanists and housing activists believe the bill will shift California cities into a denser, transit-oriented, multi-use future. But an unlikely coalition has emerged in opposition: homeowners who don’t want their neighborhoods to change and advocates for the lower-income people of color who almost always get hurt by gentrification.

This isn’t some dry policy fight. The mayor of Berkeley called the bill “a declaration of war against our neighborhoods.” A Los Angeles City Council member said it will make the residential areas he represents in LA’s tony Westside “look like Dubai.” A community organizer in LA wrote that Wiener is a “real estate industry puppet” who supports gentrification and displacement, and compared SB 827 to President Andrew Jackson’s Indian Removal Act.

Housing costs are crushing American cities, perhaps nowhere as severely as in California. It’s catastrophic—homes are priced 2.5 times the median in other places; rents are sky high; the population is increasing (but construction of places to live for them is not); poor people are getting pushed out; homelessness is severe, and on the rise.

Wiener says his fix can, over time, address all that without worsening the state’s drumbeat of evictions. And it'll do even more: “If you want to limit carbon and reduce congestion on freeways, the way you do that is by building a lot more housing near public transportation,” he says. “You get less driving, less carbon emissions, less sprawl so you can protect open spaces and farmland, and healthier families.”

It might even work.

Wiener came to San Francisco in the late 1990s, just in time to see the first dot-com boom turn the city into the center of the world and wreak centrifugal havoc, pushing longtime residents out and housing costs up.

As a community activist and then a politician, Wiener saw the other side of the problem. It’s really hard to get anything built in San Francisco. Booms, critical to the state economy because of the tax money they dump into state treasuries, don’t benefit cities the same way. Unemployment falls to nothing, but housing costs rise. The poorest people get forced out by gentrifying newcomers. The current boom, Wiener says, “has caused lasting damage to the culture and diversity of our city.”

"When we push people into areas like Phoenix and Houston, we see the climate impacts, from flooding to sprawl, with people in these high-polluting areas where they don’t necessarily even want to be."

Wiener has been full of ideas to counteract that. He’s behind a bill to make net neutrality a state law and another to let bars stay open until 4 am. (“Great cities have great nightlife,” he says.) He got a bill passed to force California cities to live up to their unenforced commitments to build new housing. And now he’s saying that within walking distance of mass transit, housing shouldn’t be single-family, suburban style. It should be tall, like 45 feet or up to 85, depending on how wide the street is.

The goal, Wiener says, isn't Hong Kong–style high-rises. It's what housing advocates call the “missing middle,” things like side-by-side duplexes, eight-unit apartment buildings, six-story buildings—a building form even San Francisco built plenty of in the early 20th century. Typically these are wood-frame construction, cheaper to build than luxury steel-and-glass high-rises.

If cities don’t build those housing units, other places will. “People first look for cheaper housing as far away from their jobs as they can that is still a reasonably feasible commute,” says Ethan Elkind, director of the climate program at UC Berkeley Law School’s Center for Law, Energy, and the Environment. “When we push people into areas like Phoenix and Houston, we see the climate impacts, from flooding to sprawl, with people in these high-polluting areas where they don’t necessarily even want to be.”