“They were urinating and defecating and doing drugs in the open,” Ms. Hockenbury said. “The people from the community couldn’t use it any longer as a place to sit and relax. It was totally taken over.”

In late October, Ms. Hockenbury’s group requested a meeting with local elected officials, the Police Department, parks officials and advocates for the homeless. Since then, the homeless presence in the square has dropped sharply, following stepped-up enforcement by the police. There is a new sign prominently displayed that alerts visitors to the 1 a.m. curfew.

Other areas are still grappling with large clusters of homeless people, which can sometimes lead to clashes. One morning this fall, Cheryl Pientka was walking her cairn terrier, Sasha, in Fort Greene Park in Brooklyn. While she almost never lets her dog off the leash, on this day she did, near a group of homeless people who had taken to sleeping under the trees between the tennis courts and DeKalb Avenue.

“She went over and started sniffing a man who was lying on the ground, and he jumped up and started swearing,” said Ms. Pientka, a literary agent, who recalled that the man threatened sexual assault. “He was over six feet tall and 200 pounds. It was totally unacceptable.”

Still, Ms. Pientka said, she feels compassion for homeless people. “I wish there was a budget to help people get skills and get on their way — or at least make the shelter system a place that they want to go,” she said.

In the Tremont neighborhood of the Bronx, a large group of street homeless people regularly occupies Devanney Triangle, a square that measures only a tenth of an acre, off the Grand Concourse. The group has grown so large that residents of the neighborhood have stopped using the park.

“It’s green and we’re a community with very little open space, but unfortunately people are becoming more and more frustrated because they feel that they cannot just sit there because of all the homeless folks,” said Xavier Rodriguez, the district manager of Community Board 5.