For superstitious reasons, 13th Street in San Francisco is called Duboce, and Duboce eventually becomes Division Street, running beneath a freeway that splits right to Oakland and left toward the Golden Gate Bridge. It was here, where the sidewalks had little foot traffic and there was some shelter from the rains, that a settlement of homeless people grew up in the past year. It was much like a smaller version of the favelas of Rio do Janeiro or the colonias of Tijuana, yet big enough to upset the San Franciscans driving by. Mayor Ed Lee hated the Division Street encampment, and after San Francisco got the Super Bowl out of the way, he busted it.

I watched the eviction with UC Berkeley sociology graduate student Chris Herring, who is studying the city’s interaction with its homeless for his dissertation. It was a messy business. First the city scrambled to make things pretty for the Super Bowl, pushing a bunch of homeless people into the encampment, and then, improvising under pressure, it pushed them out again. Herring says the city agencies were reluctant to do the dirty work of pushing the homeless out. “It was the normal chaos of handling this issue,” he says. “Every agency has some prerogatives and then they get this order from the mayor, which none of the agencies really wish to act on, and ultimately they act in a way which is really uncoordinated. It’s really frustrating for the city workers as well as for the people themselves.”

By the time Mayor Lee pulled the trigger, I had come to the conclusion that there’s a better way. Why not set up legalized encampments for the homeless?

It turns out Seattle and Portland already have legal encampments and even Sacramento is looking at legalized sites. With legal campsites, you can provide toilets, showers and garbage collection and not end up with the inevitable slum on the street. Herring says it’s at least part of the solution: “There are people who much prefer to be in a legalized encampment. They’re more affordable, there’s more community support behind them. Obviously it’s not a long-term solution, but it’s a totally acceptable and necessary option considering the current crisis.”

But it ran counter to a powerful opposing force: What San Francisco wanted was for the homeless to disappear.

I’m an epidemiologist by training, earned my Ph.D. from Cal, and spent 15 years of my life doing infectious-disease studies in the homeless population of San Francisco. I watched the growth of the mini-favela on Division Street with what you might call professional interest. But what actually got me out of my car was a woman named Dawn. In the weeks leading up to the Super Bowl, Dawn maintained a full-on field kitchen complete with gas stove in an encampment off Division Street. She also had a Christmas tree. I was impressed by her maintenance of domestic order out there. But it took me a while to overcome my hesitation and get out of the car and walk around the mini-favela, and then another while to ask people if it was OK to photograph. By that time, Dawn was gone, her encampment scraped clean and re-landscaped by the city.

San Francisco has a bad reputation for homelessness. In fact, Seattle, Portland, Stockton, San Jose, San Diego and Los Angeles all have the same problem; it’s just that we’re a geographically compact city and the homeless are in our face. There were about 5,500 “street and shelter” homeless people in the 1990s and 2000s when I studied them; according to the city’s annual count there are about 6,500 now.

The homeless in the Tenderloin—mostly African American and mostly not technically homeless, but living in SRO hotels—are like the people I studied; in fact they are the people I studied, just older. On Division Street the campers are younger and whiter, and there are conspicuously more women. In the old days the drugs of choice were heroin and cocaine. Now they are meth, Xanax and prescription painkillers (although heroin didn’t go away).

There isn’t much real, current data about the homeless, but at least I know what they were like. I dig out some old papers and look it up. Many of them were fallout from the crack cocaine epidemic of the late ’80s and early ’90s who never made it back to the straight world. About 22 percent had ever had a mental illness diagnosis, 24 percent had been in state prison, and 15 to 20 percent were current intravenous drug users. The categories overlap, so that about half the homeless had one or more strikes against them. It’s probably not that different today. Many drivers passing by in their cars presume those people out there are a bunch of crazy people, ex-cons and drug addicts, and they’re probably about half right. There’s a lot of meth on Division Street. And a lot of festering garbage piles and haphazard tents and heaped-together garbage dumps abandoned by recyclers and bizarre, found-object shack constructions. The settlement looks like some nasty corner of the Third World, like Mad Max, like the return of the repressed.

I counted more than 200 tents, shacks and informal sleeping structures on and around Division before the mayor cleared it out. I never found Dawn but I found Sean, who turned out to be her old neighbor, walking with his foofy little dog. (There were a lot of dogs in the encampment, for defense and companionship, and a few dog tents looking like elf tents between the big ones.)

Sean was on his way to panhandle. He told me life was OK on Division Street but he didn’t much like the bicycle recyclers down the row. I understood; peeking in one tent, I saw the occupant shooting up between his knuckles. Bicycle recycling is the main economy of the encampment, with everybody involved in it one way and another. Everybody is involved in the drug economy too, but apparently just selling to each other; the big dealers are elsewhere.

Banding together in an encampment like this has made the homeless intolerable to large swaths of San Francisco’s citizenry. The encampment frightens them; affluent, techie San Francisco isn’t supposed to look like a slum. A couple of weeks ago, startup entrepreneur Justin Keller went public about it in an open letter to the mayor:

The wealthy working people have earned their right to live in the city. They went out, got an education, work hard, and earned it. I shouldn’t have to worry about being accosted. I shouldn’t have to see the pain, struggle, and despair of homeless people to and from my way to work every day.

Keller got flamed on social media but his comments typified a common reaction: “I shouldn’t have to see this on my way to work. Make it go away, Mr Mayor! Make that pain and despair go away.”

Crossing over Division Street I meet Randy and Maria (not their real names) camped outside the Best Buy parking lot. Randy, cooking pancakes in a frying pan, says it’s safer here where your tent is on public view than in the rougher camps round the corner on San Bruno and Vermont streets. “There are bad people here,” he warns me, and rats in the plantings. Do I want a pancake? I do, though I’m ambivalent about Randy’s filthy hands. There’s no running water available, of course, and no toilets. What people like them need, Randy says, are toilets, showers, and some low-level policing.

I hang out with them, hear about when they camped in doorways, when Maria lived in a JC Decaux toilet kiosk, when they were down at Fisherman’s Wharf. “We were there for about a minute,” Randy says. “The cop explained that San Francisco is Disneyland for tourists and we were spoiling the view.”

“Oh, you’re from Berkeley,” he says. “There’s a Berkeley graduate out here.” He points north along the row of tents.

Randy had a job in real estate once. He keeps track of things on an iPad (charging it is a problem though) and knows everybody who comes by. He and Maria pass a pipe back and forth. “Andrew’s cool,” he says, meaning they don’t have to pretend to be members of the so-called deserving poor with me. Maria sometimes trades sex for money and Randy gets his drugs cheap because his lover is a major dope dealer. They’re not model citizens. But they’re San Franciscans, as Randy says (and Giants fans, like most people out here), and they don’t have anywhere to go.

“Where are you going if Mayor Lee pushes you out of here?” I ask Maria.

She gives a tiny shrug. “I’ll go around the corner.”

Where they’re supposed to go is to the city’s new temporary shelter, miles from anywhere, on Pier 80. It’s a giant hangar left over from tech billionaire Larry Ellison’s city-subsidized America’s Cup extravaganza in 2013. It was supposed to be emergency protection from the El Niño rainstorms, but it’s been repurposed for Division Street. At the moment the press aren’t allowed in, so we’re dependent on hearsay, but what’s in the photographs is an enormous empty space with more than a hundred pallets on the floor. There are three hots with your cot and the city promises a range of ancillary services, but the place is surrounded by razor wire and there is no privacy at all. (And it’s only funded until the end of March.) Randy and Maria say privacy was the main feature of the Division encampment: You can retire to your tent, close the door and light up/shoot up or watch movies on your laptop. (I only saw a couple of laptops in the encampment. You’d need to keep a close eye on your laptop.)

Randy explains that when you’re exposed on the street, you’re watched constantly: “When you eat, when you drink, when you dress, when you shit.” It does sound horrendously objectifying. When you go inside your own tent you can reassemble yourself, get a respite from being on show. And of course the same applies to the mayor’s shelter on Pier 80, where everybody is on view all the time. It’s clear from the photographs what Pier 80 is: It’s a refugee camp.

“Pier 80 was supposed to be our El Niño shelter,” says Chris Herring, the sociology grad student. “Instead the Mayor reserved it for this group, who were highly coerced. We focused all of our [Homeless Outreach Team] workers, who are supposed to be providing medical care on the streets, to try to convince people to go into Pier 80. Which closes in a month, so people don’t see light at the end of the tunnel. When I talk to people on the streets that’s a big reason why people don’t want to go to Pier 80.”

But pressure against the Division encampment mounted. On February 19 famous ex-mayor Willie Brown used his San Francisco Chronicle column to wag his finger at Mayor Lee: “It’s time to send in the trucks.” A couple of days later Rainbow Grocery—San Francisco’s venerable, politically correcter–than–thou cooperative market—said plaintively that the homeless in the encampment were messing up its toilets and frightening delivery people in the alley. Soon the writing was actually on the wall: Mayor Lee’s administration plastered Division Street with 72-hour eviction notices—Health Code orders to vacate, citing “garbage, human feces, hypodermic needles, urine and other unsanitary conditions.”

The conditions were unsanitary, although so far as I could see the city hadn’t tried to remedy them.

With the three-day warning set to expire, the press was out in full force. Randy, his loyal Shi Tzu in his lap, explained to a TV reporter—in articulate Spanish—that he’s there because he doesn’t have anywhere else to go. The encampment was filthy; the bases of the more solid citizens like Randy and Maria swallowed up by a rising tide of garbage. Many of the tents, swaddled in random tarpaulins and plastic sheeting against the El Niño rainstorms, turned into giant, ramshackle, plastic haystacks. Randy was depressed, but he and Maria were sitting tight, not planning to move until the trucks are at the door. Tents were being disassembled up and down Division. Ashante, on the other side of Division, said he won’t move until the city gives him somewhere to go. He gave me a half-defiant, half-pathetic look. These people are defenseless, I thought. They are invisible, underground people, and when they pop up into the light of day, we’ll just push them out of sight again.

What about that Cal graduate, I asked Randy. How about an introduction?

He looked at me for a long moment. “Can you imagine how horribly humiliating that would be for him?”

So with the emergency shelter living on borrowed time, the city’s regular shelters sporting waiting lists and the welcoming Navigation Center—which takes whole camping groups and lets you hang on to your belongings while it tries to house you—full, what is the answer?

Legalize the encampment is my solution. It would certainly be cheaper than actually building housing.

Building housing is what advocates for the homeless really want, but given the time and money it takes to build anything in the city, I suggest that at least in the short run, legal campsites are a better bet. You’d only get half the street homeless in them, but then the true holdouts would be more visible: a lot of them are going to be mentally ill, and dealing with the mentally ill, in our cost-cutting society, is a special problem, a larger problem than plain homelessness. Get Dawn into a legal campsite, I say, and Sean and his little dog, and Ashante and the nameless Cal graduate, and Randy and Maria too, even if they are going to smoke meth in there.

The cops don’t show up on Division Street on Friday morning, reportedly because the lieutenant in charge is pissed off at the Mayor for putting cops on the front line. This means the Department of Public Works will have to take the brunt of the evictions—and with many of the DPW workers themselves only a couple of steps removed from homelessness, they are clearly ambivalent about being at the sharp end. The campers are surrounded en mass by an array that includes the Mayor’s Homeless Outreach Team, sympathetic social workers, and black-clad anarchists videoing confrontations. It doesn’t go well.

“My sympathies actually extend to a lot of the agencies who are propelling this,” says Herring, who is studying homeless services agencies. “I think at the end of the day most of the workers and also most of the top brass at these agencies have the same frustration as the homeless individuals, which is at the Mayor and that this is political. No one knows what the end game of even this standoff is going to be…. There’s no longer-term strategy.”

The last of the Division campers carried their belongings away on various carts, strollers and wheelchairs and the sidewalks were disinfected and hosed down. New three-day notices warned campers on San Bruno and Vermont Streets that they, too, would soon be scraped off. This time the police show up in force. The campers all have bench warrants, Herring says—“warrants for unpaid citations on things like camping on the streets. As soon as the police showed up, they packed up, playing it safe. Even though we didn’t see people being arrested, or a brute use of force, having 23 officers out on this operation today gave us a real, palpable sense of enforcement with homeless people who are caught under the law.”

By Monday, nobody is left in the encampment. It’s only a week after Brown’s intervention, which tells you something about him. Half the tents have moved around various corners, hoping the city will ignore them, and the rest have gone to the repurposed emergency shelter on Pier 80, or to other, smaller, encampments in the city, or to someone else’s neighborhood.

I shouldn’t have to see this is what Justin Keller said, and for a while at least he doesn’t have to, and nor do we. What is it that he, and we, are so afraid of?

Andrew Moss, who earned his Ph.D. from UC Berkeley in 1979, is emeritus professor of epidemiology at the University of California, San Francisco. amoss@epi-center.ucsf.edu Photographs also by Andrew Moss.

One in a series of personal Perspectives. We invite writers and readers to submit their own essays—inspiration can come from California magazine or California Magazine Online stories, the news, or issues of the day. Read more: