A look at historical images reveals that at times of war and after disasters the city has housed people in barracks, tents, and shacks—often in numbers greater than the current homeless population. Which raises a question: Could the city shelter all of its homeless in similar structures today?

After the 1906 earthquake, tents and shacks sprung up in vast encampments around the city, including at Golden Gate Park where 40,000 found refuge. Soldiers lived in barracks built directly in front of City Hall in Civic Center Plaza during World War II. And 300 people slept aboard the USS Peleliu, a now-decommissioned aircraft carrier docked near the Bay Bridge following the 1989 Loma Prieta earthquake.

The retired Navy ship and its 5,000 bunks could “temporarily house most, if not all, of San Francisco’s homeless living in tents on the streets while permanent housing is built,” suggested former Mayor Art Agnos in a September 2016 opinion piece for the San Francisco Chronicle.

The city counted 7,499 homeless people living on its streets last year, including 2,100 chronically homeless, the people who have the hardest time finding and keeping housing.

As used needles litter the streets and homeless residents become more visible across the city, the problem seems to be intensifying. Meanwhile, as incredible wealth saturates the region, some question why the city cannot house everyone who sleeps outdoors.

“We definitely need emergency shelter,” says Megan Hustings, interim director of the National Coalition for the Homeless. “There are folks dying on the streets right now.”

Homelessness was once rare in the United States. Decades ago, the Department of Housing and Urban Development provided federal funding for hundreds of thousands of housing unts, much of it in towers long ago torn down.

”We massively defunded federal affordable housing programs in the ’70s and ’80s,” says Hustings. “That’s directly responsible for the massive homelessness we see today.”

As homelessness intensified, San Francisco officials tried to address the problem repeatedly. But growing needs always outpace their efforts.

In 2016, Mayor Lee responded to escalating frustration when he launched the Department of Homeless Services and Supportive Housing. In fact, the new department started using disaster response methods to address homelessness.

“In the past year the city has really started acting more like it’s an emergency,” says Jeff Kositsky, director of the new department. “We have been able to do things faster, and we’re coordinating better.”

Operating under an emergency ordinance, the new department brought together five city agencies in a command center once reserved for major crises. Now, if a call to the city’s 311 system reports a problem in a tent encampment, people in the same room can organize a response, including sending a social worker, providing medical care, or cleaning up used needles.

The department also moved quickly to expand the number of shelter beds. In addition to the 2,000 beds that already existed, the city added 750 shelter beds since 2016, including 621 places at navigation centers.

Like the response to the 1906 earthquake, most new shelters are going up on unused government property. Of the five new navigation center centers, many exist on Caltrans sites near highways. One opened in August in South of Market, not far from the Rainbow Grocery co-op.

The city also offers permanent affordable housing on former military sites, like the Presidio and Hunters Point.

“Right now, the housing on Treasure Island is old officer’s quarters that is housing about 500 homeless families,” says Kositsky.

The Department of Homelessness will also create 800 new permanent supportive housing units over the next five years, which will supplement the current stock of roughly 7,500 units.

But San Francisco must face a harsh reality: Only a fraction of the total homeless population will benefit from the growing number of shelter beds and permanent housing units.

What about housing the rest in ships, barracks, or tent encampments?

“Absolutely,” says Kositsky. “If I had an unlimited amount of money, I would do all of those things.”

The city will spend $271 million on homeless services this year, up from $167 million in 2014. Most of these funds provide permanent housing and rent vouchers for thousands of formerly homeless people. Less than a quarter of the homelessness budget will fund temporary shelters.

The budget reflects a tricky balance. Residents pressure officials to sweep the homeless out of sight and into temporary shelters. But advocates argue that shelters do not solve the underlying problem.

Even if a city doesn’t invest much in putting up a tent or providing a bed on a boat, “it’s still time and it’s still money,” says Hustings of the National Coalition on Homelessness. “For people living outdoors, we would always encourage cities to let them be while we focus our energy and our time on a more permanent solution.”

In fact, in the mid-2000s San Francisco prioritized the creation of permanent housing. During that time, the homeless population fell from 8,640 in 2004 to 7,499 in 2017. But the problem seemed to intensify. As neighborhoods like MidMarket near Twitter’s headquarters developed, gentrification pushed out residents living on the streets. As they dispersed, many housed residents started to see homelessness closer to where they live and work.

Under the city’s current plans, thousands of people will remain homeless for years to come. But local advocates have a plan to close much of the gap. A group that includes Jennifer Friedenbach, executive director of the Coalition on Homelessness, secured a place on November’s ballot for Proposition C. If passed, the measure would tap some of the city’s extraordinary wealth to double the city’s spending on homelessness.

“San Franciscans should not have to step over homeless people or walk out their doors and see tents on sidewalks,” according to the initiative’s text. “And homeless people should not be forced to live in these conditions.”

The controversial measure would raise $300 million from a tax on companies that earn more than $50 million per year. The San Francisco Chamber of Commerce, which opposes Proposition C, says it would hurt the city’s middle class. Proponents say that within five years of passing, the new funding could provide permanent housing to 4,000 and temporary housing to an additional 1,000.

But if the number of temporary shelters expands rapidly, they probably will not look like barracks in the Presidio or shack encampments in Franklin Square.

Homeless people often have different needs from soldiers and earthquake refugees, says Kositsky. Compared to the weeks or months needed to repair a home after a natural disaster, a homeless person often must wait years for permanent housing. Some homeless also struggle with untreated mental health and substance abuse problems, which need a higher level of care than can be provided in mass housing.

Ultimately, solving homelessness comes down to a difficult moral choice: shelters versus permanent housing.

”Shelters don’t end people’s homelessness,” said Kositsky. “It’s only solved by finding people permanent housing.”