The impending closure of two large encampments this week, in Oakland and Berkeley, has sparked debate over how the cities and other government agencies decide when to clear homeless settlements that are proliferating across the area, and when to let them be.

Oakland plans to disassemble more than 20 homes built of wooden pallets under the BART tracks near the Coliseum Station on Wednesday. The breakdown is a precursor to a crackdown the city plans on pallet homes, citing safety and fire hazards. Residents aren’t being given alternatives such as shelter beds because city officials say they can stay — just not in the fire-prone pallet structures.

In Berkeley, Caltrans plans to shut down a homeless encampment of close to 50 people beneath an underpass near Interstate 80 and University Avenue. The city is not involved, and there is no plan for resettling the residents elsewhere or giving them shelter beds.

“As a governmental agency, we have a duty and obligation to maintain public safety and public health, but at the same time, as a resident, as a citizen, you have certain freedoms and autonomy,” said Daryel Dunston, from Oakland’s Department of Human Services. “But when those freedoms and autonomy starts to jeopardize the general public’s safety, the general public’s health, well that’s the need for government to intervene.”

But homeless people and advocates say those living in the encampments have few options of where to go with only a few days notice and shelters at capacity.

“We are literally wasting hundreds of thousands of dollars pushing people from one sidewalk to another sidewalk,” said Talya Husbands-Hankin, a member of Oakland’s homeless advocacy working group. “It is unnecessary for people to be crammed under overpasses surrounded by rats in these extremely unsafe and degrading environments. We could be providing nicer tents for people, showers, toilets, all of these things as an emergency measure. I’m not saying that is a solution, but because the problem is so huge, we need to be more creative and more expansive.

“What we are seeing on the ground is not lining up to what (the city) is saying is their policy,” she said.

The closures come as President Trump sent a fact-finding team to Los Angeles to look into addressing homelessness there, with reports that the administration is considering a federal role in building and running shelters, though there was no indication of similar plans in Northern California. Oakland Mayor Libby Schaaf brushed off the news, saying, “If he is sincere about helping California with its homelessness problem, he will help us produce affordable housing, not sweep our fellow humans from the street.”

Homelessness has doubled in the past four years in Alameda County with the latest figures showing a 43% increase. The numbers show an unprecedented boost in the number of people living without shelter — 93% of the total homeless numbers are unsheltered people.

In Oakland, overall homelessness increased by 47% with a 68% increase over the past two years in the number of unsheltered people — from 1,902 to 3,210 people. There are an estimated 60 encampments of three or more people in Oakland with approximately 730 total people living in the encampments. In Berkeley, the city’s homeless population increased by about 14% with a 22% increase in the number of unsheltered people — from 664 to 813 people. There are an estimated 15 encampments in Berkeley with three people or more, according to data presented at a June meeting with Alameda County mayors and the Board of Supervisors.

Officials from both Berkeley and Oakland say their approach is to refrain from shutting down encampments unless they can offer an alternative place to stay and if there isn’t an immediate safety or health risk. In Berkeley, the options are either a shelter bed or a space at Pathways Stair Center, the city’s Navigation Center. Oaklandofficials say they shut down large encampments only when they can move people into one of the city’s emergency shelter options, including community cabins or RV safe parking sites.

But advocates insist that it doesn’t always play out that way, and homeless people are being forced to rebuild on another street or in another neighborhood, oftentimes without any form of shelter or help.

In Berkeley’s case, it is Caltrans’ decision to remove the encampment near the I-80 interchange. Berkeley officials are aware of the move, but said there is little they can do about it.

Caltrans is “making their decisions on an encampment based on their own operations, and it has no relationship to our availability of anything or resources, they’re setting their timeline,” said Matthai Chakko, a spokesman for the city.

But that isn’t good enough, said Andrea Henson, a homeless advocate who also works as an intern at the East Bay Community Law Center. Henson said she planned to attend Berkeley’s City Council meeting Tuesday to urge officials to offer solutions for the people affected by Caltrans’ promised removal of the encampment.

“We just want the city to answer, where do they go?” Henson said. “They want housing, but there is just no housing. Some of them have been Berkeley residents for 30 years. You’re telling them they can’t be anywhere.”

Caltrans did not respond to a request for comment.

In Oakland, the claim by homeless advocates that the city’s encampment policies aren’t playing out the way they should be has one councilwoman calling for an audit.

Councilwoman Nikki Fortunato Bas said the audit will look at what is working, how to change the city’s practices and look at what other cities are doing and innovate to address the homeless crisis.

When advocates heard that Oakland planned to destroy the makeshift homes under the BART tracks in East Oakland, they urged the city to hold off so they could raise funds to buy tents for the homeless people that would be affected. The city agreed to a two-week delay. So far, the fundraiser has raised enough money for 18 out of 21 tents. Money has also been raised for 30 fire extinguishers, smoke detectors, solar panel lanterns and building materials so advocates can build platforms for the tents to sit on to avoid rat nesting and infestation, said Candice Elder, the executive director of East Oakland Collective.

“We are trying to mitigate some of the safety and fire concerns that the city rightfully had, but didn’t do the proper steps of mitigating those concerns,” Elder said.

But for Jamie Dong, 38, who has been living in a pallet home under the BART tracks in East Oakland with more than a dozen other homeless people, the future is uncertain. The makeshift home provides a sense of safety that tents never did.

“I can protect myself,” Dong said. “Everyone is scared to come in here because they don’t know what to expect. I’m scared of feeling unsafe in a tent.”

Her neighbor, Pastor, 47, agreed. Pastor has a pallet home that has a bed, television and sink. He’s converted the structure into a tiny unit and has been working to cover it with a metal sheet in hopes that the city will determine it is up to fire code Wednesday and let him keep it.

“I don’t know what’s going to happen,” said Pastor, who declined to give his last name for personal safety. “Tents are not safe. People steal. But in here, nobody can touch anything.”

Sarah Ravani is a San Francisco Chronicle staff writer. Email: sravani@sfchronicle.com Twitter: @SarRavani