Philadelphia is launching a pilot program to begin clearing out homeless encampments in Kensington, an area that has become ground zero in the city’s opioid crisis.

City officials announced Thursday that the new program, the result of four months of planning, aims to permanently close two of the four largest encampments that have formed under the railroad bridges just north of Lehigh Avenue, and to move up to 90 people off the streets.

Liz Hersh, director of the city’s Office of Homeless Services, said city shelters have additional capacity to take them in if they accept shelter.

“We have the ability to expand the capacity if we need to,” said Hersh. “If it turns out that everybody raises their hands, we will move heaven and earth to find a place for them to come into so we don’t lose that moment when they’re willing.”

The encampments — densely packed rows of tents and makeshift structures — sit in tunnels along Kensington Avenue, Emerald Street, Tulip Street, and Frankford Avenue, not far from the gentrifying sections of the historically low-income neighborhood.

In an effort to avoid a “media circus” as outreach workers and police move in, the city is not saying which of those encampments are part of the pilot, when the work will start, or how long it will take. But the program is based on methods used in other cities, including San Francisco, to systematically close the camps and remove residents, while helping to get them into shelters or treatment.

Most, if not all of the residents of the Kensington encampments are not only homeless, but suffering from opioid addiction. Hersh said that presents a big challenge for outreach workers.

“It’s challenging to really reach through to people,” she said. “People become hopeless, and so, we have to believe in them and help them believe they can have a different future.”

The program begins with a period of “intensive engagement” with the residents of the camps, during which outreach workers will find out what kinds of services people need, and which they’re willing to accept.

Outreach workers will then spend time trying to connect people to those services, whether that’s space at a shelter, a referral for a drug treatment program, or help getting an I.D. or medical attention.

“It really is a person-centered approach,” said Hersh.

The city will allow the camps to stay put for a period of time so outreach workers can meet with residents, but police will eventually move in and close them down.

The pilot program is a coordinated effort among several city agencies, including Hersh’s office, the city’s Department of Behavioral Health and Intellectual Disability Services, the Philadelphia Police Department and the Philadelphia Streets Department.

Since 2016, a similar program in San Francisco has helped closed 23 encampments comprising more than 900 people as of December.

“We’ve got people camping out under overpasses to get out of the rain. We’ve got people in certain residential neighborhoods. We also have people trying to set up encampments in parks or in out of the way places,” said Jeff Kositsky, who heads the San Francisco Department of Homelessness and Supportive Housing.

Kositsky said the program is rooted in collaboration, compassion, and upholding residents’ civil rights.

Outreach workers clear encampments over the course of a month. The process starts like Philadelphia’s with a weeklong period of engagement, where outreach workers inform residents and neighbors the camps will be closed.

The second week focuses on assessing the needs of camp residents. That includes identifying people with serious medical or mental health issues and arranging care. Outreach workers also figure out how many shelter beds will be needed and start making calls to ensure they’re available when the camp is cleared out.

During the third week, residents start to relocate. There’s also a health fair with doctors, where people struggling with addiction can get suboxone, a drug used to help wean people off opioids.

Moving continues during the fourth and final week of the program until the last day or two, when police and employees with the Public Works Department start cleaning up the area.

“We will issue official notices that that they will need to vacate within 72 hours,” said Kositsky. “If there’s anybody left at that point we’re scrambling to get them to come into shelter, making reservations for them.”

Roughly two-thirds of the former residents of the encampments accepted shelter. A quarter have found permanent housing.

“It’s progress, but not success,” said Kositsky.

During that same stretch, 16 of the 23 camps have remained closed.