Just finished The Help by Kathryn Stockett and absolutely loved it. At the end, she includes a personal story and says, "I wrote The Help while living in New York, which I think was easier than writing it in Mississippi, staring in the face of it all. The distance added perspective. In the middle of a whirring, fast city, it was a relief to let my thoughts turn slow and remember for a while."
I have written a short story set in Santa Cruz while I lived there. I am now writing a novel set in Nevada City while I am in Honolulu. For me, I like both ways. Writing from up close can feel pleasantly like an exercise. You can go to the location and describe what you see. Inspiration can flow a little easier.
Being farther away, I set the scene using what stands out the most to me and what seems most important, through the lens of memory. I'm nomadic, so I'm sure in my life, I'll write about where I am and sometimes about where I've been.