GPS is a fine tool for finding a route between two places when there is a driver controlling a car, but as we near an era of fully autonomous vehicles, that technology is in need of a major upgrade.

That’s why Tesla is not just in the process of creating its own maps but is deciphering where each individual lane is on every road, across the globe. It’s doing this in part by tracking every one of its Model S cars each time a customer takes a drive, to learn where traffic typically moves. The project is immense but it is necessary if autonomous cars—which Tesla expects to be a reality in three years—are to work properly.

Tesla announced yesterday (Oct. 14) that it was upgrading all of its Model S vehicles with new functions that allow the cars to steer, switch lanes, and park autonomously (though it advised drivers not to actually take their hands off the wheel). Currently, tricks like autonomous lane-changing require a driver to indicate first, and for the car to rely on onboard sensors to decide when it is safe to change lanes.

But a fully autonomous car will need to know which lane it’s already in, how many lanes there are on the road, and where those lanes lead to—or end. Onboard sensors alone can’t generate this level of data. Elon Musk, Tesla’s CEO, believes this mass collection of data—Tesla plans to build around 50,000 cars this year—will set the company’s cars apart from rival auto makers who are preparing their own self-driving cars.

Certainly, tracking existing drivers will give Tesla a head start against “legacy” auto makers such as BMW, which, along with a consortium of other German brands, bought mapping software from Nokia earlier this year. But two more contenders for the autonomous car space may have an even greater advantage than Tesla: Apple and Google.

These companies could potentially track hundreds of millions of smartphones as their owners drive them from place to place, making their future road maps many times more accurate.