In the blockbuster movie The Martian, Matt Damon plays Mark Watney, a brainy botanist who coaxes spuds to sprout in otherwise lifeless dirt.

As the population rises here on Earth, there are plenty of harsh, foodless environments that could be improved with a little ingenuity. And in a plot rooted in plausible science, it turns out that much of what Damon’s character did to turn his Martian "hab" into a makeshift greenhouse is applicable here.

The film’s release dovetails with the United Nation’s International Year of Soils, and it probably does as much to raise awareness that soil, like water, is a limited resource, says Harold van Es, a soil scientist at Cornell University.

Soil is created when glaciers, wind or other elements slowly transform rock materials into something softer and more fertile. Scientists say it can take 200 to 400 years to form one centimeter of new soil. Meanwhile, human actions such as slash-and-burn agriculture, deforestation and global warming are causing soil erosion and degradation at alarming rates, not to mention the amount of arable soil that gets lost to pollution.

“Going to Mars is a very interesting prospect, but ultimately that will be very difficult,” van Es says. “We need to learn to live with larger numbers of people on this planet.”

The movie depicts Watney taming inhospitable Martian soils by first creating water from rocket fuel—which is perfectly reasonable science, says Jim Bell, a planetary scientist from Arizona State University who is an expert on Martian dirt. That water comes in handy for rehydrating freeze-dried human feces, which Watney uses as fertilizer. (In the book, Watney also adds some fresher supplies to the mix.)

Poop isn't that far fetched as a soil amendment on Earth: Washington, D.C., is among a growing number of cities turning what’s flushed down toilets into compost. The city’s garden plots already are using that nitrogen-rich compost to improve depleted urban soils—and grow a mean tomato.

One of van Es’ students is also using treated toilet materials to grow food in Nairobi, Kenya, where a legacy of growing maize has depleted the soils over time. Charred to stabilize it, the processed human waste can infuse nitrogen and necessary minerals back into the soil.

Watney had to conserve every drop of water he created on Mars, even with a futuristic water reclaimer similar to what real-life astronauts on the International Space Station use to recycle their wastewater.

We also do this to some extent on Earth, where so-called gray water that washes down bathroom sinks is recycled to water golf courses and keep machinery from overheating. As drought stretches on in much of the American West, gray water isn't just recycled for irrigation but is increasingly being marketed as drinking water as well, after treatment steps that include filtering and UV exposure.

One issue The Martian didn't address is that on the real Mars, astronaut farmers would have to contend with contaminants in the dirt. In 1999, NASA's Phoenix lander discovered a nasty material called perchlorate in Mars soil that's "very harmful to life as we know it," Bell says.

Back on Earth, farmers in some areas have already had to deal with potentially dangerous pollution. Many urban soils contain traces of their industrial pasts in the form of lingering lead or arsenic. The most common solution involves piling untainted soil on top or into growing containers.

But closed-loop systems show great potential for working around poor soils or actually improving them. This includes hydroponics that grow fish and plants in symbiosis, or systems that rotate crops to infuse nutrients back into the soil.

Scientists also are learning how to grow crops in the radioactive environments associated with planets that lack Earth’s atmospheric protection. Nuclear power plant accidents, if you can say they have a silver lining, have given researchers the chance to discover crops that thrive in radioactive soils. Oil-rich flax plants, for example, flourished near Russia’s Chernobyl Nuclear Power Plant.

But human ingenuity aside, the best path to a flourishing future food supply is to not waste the resources we have in the first place.

“The movie brings out the idea that human life really depends on our ability to produce food,” says van Es. “We take that for granted.”