Judge David Carter, a U.S. District Judge, tours a Southern California homeless encampment in Santa Ana, Calif., Wednesday, Feb. 14, 2018. Judge Carter demanded that Orange County officials provide answers about what federal funding is available to feed and temporarily house people if they are moved. (AP Photo/Amy Taxin)

Judge David Carter, a U.S. District Judge, takes a cellphone photo of a sign posted in the encampment that reads "You have somewhere to put the trash but nowhere to put us," during a tour of a Southern California homeless encampment in Santa Ana, Calif., Wednesday, Feb. 14, 2018. Judge Carter demanded that Orange County officials provide answers about what federal funding is available to feed and temporarily house people if they are moved. (AP Photo/Amy Taxin)

Judge David Carter, a U.S. District Judge, center, speaks with Brooke Weitzman Northeastern University attorney for the plaintiffs, left, and Marianne Van Riper, ‎Orange County Counsel's Office senior assistant counsel, right, during a tour of a Southern California homeless encampment in Santa Ana, Calif., Wednesday, Feb. 14, 2018. Judge Carter demanded that Orange County officials provide answers about what federal funding is available to feed and temporarily house people if they are moved. (AP Photo/Amy Taxin)

Judge David Carter, a U.S. District Judge, center, walks with Brooke Weitzman, attorney for the plaintiffs, right, and Marianne Van Riper, ‎Orange County Counsel's Office senior assistant counsel, left, during a tour of a Southern California homeless encampment in Santa Ana, Calif., Wednesday, Feb. 14, 2018. Judge Carter demanded that Orange County officials provide answers about what federal funding is available to feed and temporarily house people if they are moved. (AP Photo/Amy Taxin)

U.S. District Judge David Carter, right, speaks with homeless resident Ronald Heatley, 56, as he cleans up the area on the riverbed during a tour of a homeless encampment along the Santa Ana River in Anaheim, Calif., Wednesday, Feb. 14, 2018. Carter demanded that Orange County officials provide answers about what federal funding is available to feed and temporarily house people if they are moved. (AP Photo/Amy Taxin)

U.S. District Judge David Carter and his entourage cross the Santa Ana River during a tour of a homeless encampments in Anaheim, Calif., Wednesday, Feb. 14, 2018. Carter demanded that Orange County officials provide answers about what federal funding is available to feed and temporarily house people if they are moved. (AP Photo/Amy Taxin)

U.S. District Judge David Carter, left, speaks with workers cleaning up syringes mixed in with trash along the riverbed trail during a tour of a homeless encampment along the Santa Ana River in Anaheim, Calif., Wednesday, Feb. 14, 2018. Carter demanded that Orange County officials provide answers about what federal funding is available to feed and temporarily house people if they are moved. (AP Photo/Amy Taxin)

U.S. District Judge David Carter speaks with 41-year-old homeless resident Lori Werner during a tour of a homeless encampment along the Santa Ana River in Anaheim, Calif., Wednesday, Feb. 14, 2018. Carter demanded that Orange County officials provide answers about what federal funding is available to feed and temporarily house people if they are moved. (AP Photo/Amy Taxin)

U.S. District Judge David Carter speaks with 36-year-old Shane Allen, who is homeless and in a wheelchair, during a tour of a homeless encampment along the Santa Ana River in Anaheim, Calif., Wednesday, Feb. 14, 2018. Minutes later, county officials said they had arranged for Allen to move to a motel room. Carter demanded that Orange County officials provide answers about what federal funding is available to feed and temporarily house people if they are moved. (AP Photo/Amy Taxin)

A sign is seen posted along a county-owned trail in a Southern California filled with homeless encampments amid a lawsuit over efforts by local officials to shut it down in Santa Ana, Calif., Wednesday, Feb. 14, 2018. In Orange County, Judge David Carter asked for volunteers from the courtroom to be ready to walk the site and identify veterans and abused women who need assistance. The judge also has questioned whether an adversarial setting like a courtroom is the best place to find solutions to a problem that has overwhelmed some cities. (AP Photo/Amy Taxin)

Judge David Carter, a U.S. District Judge, center, followed by an entourage of three dozen lawyers, Orange County workers, nonprofit staff and local officials, tours a Southern California homeless encampment amid a lawsuit over efforts by local officials to shut it down in Santa Ana, Calif., Wednesday, Feb. 14, 2018. Judge Carter also demanded that Orange County officials provide answers about what federal funding is available to feed and temporarily house people if they are moved. (AP Photo/Amy Taxin)

Judge David Carter, a U.S. District Judge, sixth from left, pointing, followed by an entourage of three dozen lawyers, Orange County workers, nonprofit staff and local officials tours a Southern California homeless encampment amid a lawsuit over efforts by local officials to shut it down in Santa Ana, Calif., Wednesday, Feb. 14, 2018. Judge Carter is overseeing a lawsuit filed by homeless advocates over the planned closure of the encampment on the county-owned trail. (AP Photo/Amy Taxin)

ANAHEIM, Calif. (AP) — Stepping over syringes and feces, federal judge David O. Carter walked briskly Wednesday with an entourage of government officials and lawyers along a bike trail by the Santa Ana River in Southern California, passing dozens of homeless tent-dwellers who must now look for a new place to live.

Carter, who served in the Marines, stopped to snap cellphone photos of garbage heaps and a sign in the sprawling encampment reading, "you have somewhere to put the trash but nowhere to put us."

Carter spoke with people living at the encampment about a plan he is overseeing to move them Tuesday into county-provided motel rooms and other short-term housing.

"It's going to be done as humanely as possible," he told a pair of homeless women who approached him. "But you've got to be prepared to move."

The visit came a day after Carter told Orange County officials in his courtroom that they need to give the homeless a place to go before forcing them to leave the two-mile (3.2 kilometer) long riverbed encampment that has swelled in recent years to include hundreds of people.

Authorities announced plans to close the encampment last month and were pursuing the effort until they were sued by advocates who said the tent-dwellers had no place to go after police in nearby cities forced them from streets and sidewalks to the riverbed.

After Tuesday's court hearing, county officials agreed to provide 400 motel rooms and other short-term housing to those evicted from their trailside digs.

The case is being watched by advocates in many West Coast cities grappling with a rise in homelessness and encampments amid soaring housing costs.

It isn't the first visit that Carter, who is in his 70s, has made to the county-owned trail that runs past the stadium where the Los Angeles Angels of Anaheim play.

He walked through the encampment during an earlier lawsuit and has told attorneys he didn't want to waste time looking at their photos when he could see the area for himself.

Known for an unconventional style that includes hauling officials into his courtroom and putting them on the spot, Carter is nudging both sides toward a resolution. He asked them to draft an agreement on Wednesday, and said he'd be available for questions until midnight.

Carter walked quickly during the four-hour tour, forcing lawyers to rush to keep pace. The judge peppered county workers with questions about bathroom access after pointing out a urine-filled water bottle, and about accommodations for disabled people after speaking with a 36-year-old man in a wheelchair who said he was veteran and is battling cancer.

"There's going to be people to help you," Carter told Shane Allen. Arrangement were made later in the day for Allen to be moved to a motel room.

A short time later, Carter walked into the largely dried-out riverbed, retrieved a discarded plastic water jug and ordered county officials to clean up the area or he would call in environmental groups to do the work.

Homeless advocates and officials are still sorting out details involving longer-term housing, and other arrangements have yet to be discussed. However, people on both sides of the case said Carter had moved things along.

"It's a definite fulcrum to force all parties to compromise a little bit," said Kris Murray, a councilwoman in Anaheim, another defendant in the lawsuit.

Still, some people living along the riverbed said they don't know what the future will hold.

Lori Werner, 41, said she would gladly move to a motel room next week. But with her husband in jail and her children taken from her over drug use, she doesn't know where she would go next.