Imagine yourself on a sidewalk in the center of a crowded city. It’s summer, the afternoon rush hour, you’re surrounded by buses, cars and delivery trucks, and they’re blasting you with waves of hot, nasty exhaust fumes. Now imagine stepping away from that chaotic scene, ducking into an elevator and riding up a few dozen floors where you emerge to find a green oasis of vegetables and flowers — a rooftop farm. Sprouting in cities worldwide, rooftop farms are adding a bit of green to the gray, drab concrete of our packed urban centers. They are reconnecting city dwellers with nature. They are teaching consumers about homegrown food. And they are offering perhaps a glimpse of a more sustainable, secure and accessible food supply. New York, a leading pioneer in rooftop farming, has large-scale gardens in the boroughs of Queens, the Bronx and Brooklyn. Urban farmers in Tokyo are taking their spades and shovels not only onto their roofs, but also into underground bank vaults that have been turned into farms. And in Hong Kong, jammed with huge office and residential towers, rooftop farms are also making their mark. I recently visited Cityfarm, a rooftop operation in Hong Kong, which I write about at more length here. Located on the roof of an industrial building, this 10,000 square-foot farm has nearly 400 plastic planter boxes. The planters, made in Taiwan, are filled with soil imported from Denmark and Germany. A quick walk around the farm reveals an impressive array of vegetables: dark leafy greens like choy sum, baby watermelons the size of ping-pong balls, foot-long “hairy gourds” (a Chinese variation of the zucchini), little herb seedlings and the occasional massive pumpkin. “For a small investment in planter boxes, I filled up the roof and turned it into a farm,” says Osbert Lam, the owner of Cityfarm. Cityfarm hosted a rooftop barbecue party on Saturday to celebrate the Mid-Autumn Festival, an ancient Chinese festival that traditionally marked the end of the harvest season. Under a sparkling full moon, with colorful lanterns hung around the farm, Mr. Lam served up plates of homegrown vegetables, including crisp green peppers, succulent mushrooms and a meter-wide pumpkin.