Crops including cucumbers, potatoes and lettuce can have yields up to four times as high when they're grown in urban rather than rural areas, new research reveals – and that's an important finding for the future of farming.

Right now, it's thought that 15–20 percent of global food is grown in cities, including 5–10 percent of all legumes, vegetables and tubers. But we need a lot more data to figure out whether or not bulging cities can support themselves.

As city living continues to become more common across the world, the team behind the new study wanted to investigate the viability of urban agriculture as a way of improving food security, resilience, and sustainability.

"Despite its growing popularity, there's still quite a lot we don't know about urban agriculture, like whether the yields are similar to conventional agriculture, or even what crops are commonly grown," says environmental scientist Florian Payen, from Lancaster University in the UK.

Through an analysis of 200 previous studies – covering 53 different countries and more than 2,000 data points – the team was able to get some definitive answers. Crucially, the analysis covered 'gray' spaces (like roads and rooftops) as well as green spaces (such as parks and allotments).

In terms of which urban spaces work best for crop growing, there was no clear winner. However, some types of crops are particularly well suited to certain ways of growing, the research shows.

For example, watery vegetables (such as tomatoes) and leafy greens have high yields in hydroponic environments, where water is used instead of soil.

Foods like lettuces, kale and broccoli are more naturally suited to being grown vertically, the researchers found. The study also showed that urban farming is going to work better for certain types of produce than others.

"Surprisingly, there were few differences between overall yields in indoor spaces and outdoor green spaces, but there were clear differences in the suitability of crop types to different gray spaces," says Payen.

"You can't exactly stack up apple trees in a five or ten-layer high growth chamber, though we did find one study that managed to grow wheat stacked up like that."

What remains unclear is just how cost-effective urban farming is versus rural farming. The cost of running climate-controlled environments for growing food and employing any required staff are both factors to consider.

Developing urban agriculture could be beneficial in a whole host of different ways – from being better equipped to survive the next pandemic to reducing the environmental cost of food production – and now we have some solid data on just how viable it is.

Further research could look at how easily certain urban farming techniques could be scaled up, and how city pollution might affect the quality of crops. There's still lots to explore, but this is a solid foundation to get started from.

"This is the first step," says Payen. "That's the strength of this dataset, for planners and policymakers to be able to see if it's worth it to invest in rooftop gardens or greenhouses, for example, or if hydroponic systems would be better."

The research has been published in Earth's Future.