Where It All Goes Down
"Song of Myself' is set in too many locations to name. At the same time, you could argue that the speaker goes to all of these places without moving anywhere at all. He just wants to "loafe" and look at a blade of grass, but the contemplation of this single "spear of grass" leads to thoughts about America, the world, and even the universe.
The primary setting is America as a whole. Unlike other Whitman poems, which are set in New York City or out in the countryside, "Song of Myself" travels quickly from place to place, both rural and urban, mimicking the metaphorical "journey" of the speaker. For example, Section 8 captures something of the chaos of the city, with "the blab of the pave, the tires of carts, sluff of boot-soles, talk of the promenaders." Meanwhile, Section 9 shifts to the countryside at harvest-time, and Whitman rides on top of a hay-cart.
One reason for these frequent shifts is that Whitman likes telling vignettes, which are small vivid stories that put us in a particular scene but do not have a conventional narrative. The story of the woman admiring the 28 bathers is one such vignette, and so is the story about attending the wedding of a fur trapper and a Native American girl.
Some of the settings seem more realistic than others. The setting in which the speaker wheels through the universe past the planet Uranus is obviously not realistic, but the story of the massacre in the Mexican-American War feels like it could have been written by a journalist who was there. Above all, Whitman hopes to give a sense of the size and span of America and her great democracy. The diversity of the setting reflects the diversity of its people.