Lots of people would be really happy for SF to set aside some land in the city for new jails. Still, that seems less practical than just opening some public restrooms...
Give them free housing of a sort, so that it’s an improvement over living on the street, but not so that currently-housed people would feel tempted to downgrade their status to homeless in order to get the free house.
The ideal free housing camp is (a) away from major population centres, (b) fairly basic, and (c) compulsory for those who wind up homeless in major cities.
It's not cheap even if you manage to get all your jails built in Sunset or some other backwater. Jail is expensive, and the homeless have no official salaries to garnish so you can't use the Ferguson method. Besides which, there's no way the state is going to take any convicted public poopers off your hands to house in their expensive prisons, so you're going to have to keep these criminals jailed for their entire sentence.
Wouldn't it be easier to open some public restrooms?