You’ve seen those lines of spikes to keep pesky pigeons from landing on the ledges of building — well, some folks in San Francisco appear to be using the same tactic to keep the homeless from roosting in front of their businesses.

“Curated railings” — metal bars topped with wrought-iron sharks’ teeth — have gone up around the flower and landscape boxes in front of the Safeway at Market and Church streets in the Castro.

“I used to sit here, but it’s kind of uncomfortable right now,” Ryan Palmer said as he moved on to rest his backpack and play his guitar elsewhere.

In fact, it’s virtually impossible for the homeless or anyone else to sit on the Safeway planters — and that’s fine with longtime customer Keith Redy, who said the “crusties” had taken over the area.

“I don’t want to have to go through a minefield when I go for a box of milk, you know?’ Redy said.

Even Bevan Dufty, the city’s point man on homeless housing, said the area “was kind of like walking through ‘Escape from New York.’.”

“It’s a challenge. I don’t know that anybody is right or wrong,” he said.

Safeway spokesman Keith Turner said the company had been looking for a way to reduce loitering around the store for the past year. He called the railings something that “complements the aesthetics yet discourages seating.”

Safeway isn’t alone in taking action. Whether it’s installing park benches that have armrests to keep people from lying down or pulling benches out of parks altogether, discouraging the homeless is becoming a part of the city’s architecture.

“We saw it when they did the Civic Center courthouse, where they put in stuff so people wouldn’t be able to sit on the ledge there,” said Jennifer Friedenbach of the Coalition on Homelessness.