San Diego City Council approved a ban on homeless encampments, as the city joins others in California taking similar actions in response to a growing social problem also deemed by some as detracting from the safety and commercial viability of many urban centers.