It occured to me, after a lifetime in the Bay Area but only the last decade and a half in San Francisco, that culturally, interactively, and geographically, that this city is an island. Surrounded by water on three sides.
I once talked with an FBI guy who'd worked with PDs around the country; he likened the SFPD to Boston cops - "they want to do things their way, the way they've always done them, because they did them first." San Francisco has the oldest police department in the state, as does Boston, another water-surrounded city, in Massachussets.
I think there may be a direct correlation between the ratio of your area's isolation by water and the residents' pride in said area. This city dweller recalls dating an Irish-American in High School who "read books on Irish history and followed current events there. To hear him talk, you`d think his family ties to the old country were fresh and strong, but the truth was that his ancestors had come over many generations ago."
Could be a factor of love/hate - sometimes I'm so sick of this place I think of moving to I dunno, Oakland. Or Mexico City. But then you're stuck here, getting out you deal with traffic, or transit, which isn't super-reliable, so you make do. And staying put, and digging in, gives you more invested reasons for liking a place. And making it to your liking.