“There’s a wide interest in rooftop farms because there are so many benefits, from environmental to job creation and food creation,” Ms. Schantz said. “There’s also a lot of interest from landlords that want to increase the value of their buildings.”

Mrs. Ostafi approached the building owner, Beau Reinberg, about putting a farm on his roof three years ago after Urban Harvest STL lost its lease on a community garden site. Mr. Reinberg, who bought the building in 2008 with plans to put a restaurant on the roof, also envisions the farm as another way to erase the Delmar Divide. But leasing the roof to a unique user still had to make financial sense instead of being a public relations gambit, he said.

When trying to determine a lease rate, he took into account the nonprofit group’s goals as well as the value of reduced energy bills and roof upgrades such as the addition of a waterproof membrane. Mr. Reinberg also researched what landlords typically charged operators of rooftop billboards and cellphone towers. The parties eventually agreed to a five-year lease that starts at $2,500 annually in the first year and escalates to $7,500 annually in the final year.

“I don’t know if eight years ago we would have said that the highest and best use for this property was sand volleyball, a storage facility and a farm on the roof,” Mr. Reinberg said on a warm day in May when workers — and nature — began dumping three inches of water on the roof to test the membrane for leaks before the farm’s construction began. “But I think that you get through four or five years of a rough economy in real estate and you start to become pretty creative in figuring out what’s going to work.”

More property owners will probably make similar creative calculations. The roof farm concept has grown out of the broader adoption of green roofs, said Bob Fisher, owner of Midwest Green Roof of Arlington Heights, Ill., an installer of Urban Harvest STL’s roof system. But generic green roofs typically feature sedums that don’t require a lot of water, and he suggested that the value of local food production in communities would generate more demand for roof farms that could equal, if not surpass, traditional green roof installations.