It’s 2025. You’re in a big city and have somewhere to be. Fire up an app and an autonomous car — with a driver at the wheel or maybe without one — picks you up.

Odds are good the company behind that car will be Uber or Google. The two are set to vie for the reigning position as the transit service platform of the future. Uber has advantages — for one, its name is becoming the verb for ride-hailing, the way Google’s has for search. But Google has the mobile platform, the lead in self-driving tech and deeper pockets.

It has another edge: Deep ties with local governments, critical players in making autonomous vehicles a reality. This proximity is thanks to Waze, the mapping startup Google bought in 2013, which has invested heavily in building data-sharing agreements with cities around the world.

These agreements do not impact government relationships with Google proper, according to Waze (although the team remains part of Google in the Alphabet companies). And the present relationship has nothing to do with autonomous driving.

But the agreements have laid the groundwork for deeper ties for a day when self-driving cars come to market. If autonomous cars are going to work, there needs to be tight coordination of transit data between governments and private companies. Before you can hail a self-driving car, there’ll likely need to be a host of things (designated lanes, re-zonings, ordinances) that let it drive itself. Then there is the planning to ensure they drive effectively. That’s why Google has cut data deals with its flagship mapping product, and why Uber is scrambling to build similar programs.

Waze is, from what we can tell, ahead. In its program, called the Connected Citizens Program, Waze hands over info reported by its users, like accidents and road closures, to urban governments free of charge. It has cut deals with 51 cities worldwide; they get fresh data from the app’s users every two minutes.

For cities, the program gives them timely, unprecedented data that helps manage traffic flows, safety and (ideally) costs. In Boston, a city not known for its sober traffic design, officials are using Waze data to measure the impact of their planning changes. “We heard that traffic improved anecdotally,” said Connor McKay, a data scientist for the city. “Now we can say that, quantitatively, traffic has improved.”

Peter Marx, chief technology officer for Los Angeles, also enthused about the program. “This is the first time that we have real-time information, really personal information, in the hands of the decision-maker,” he said. “I would imagine that we’ll start to see shifts in the patterns of behavior with drivers.”

In return, cities give Waze their own traffic data. (This is why you may see some Uber drivers using Waze to get around.) Accurate road information is critical to making self-driving cars work — hence, Uber hurriedly pouring its investor stockpile into a mapping operation.

The ballooning ride-hailing startup has had less success currying favor with city officials. It has proved it can get its way in cities, but usually after some messy standoffs.

This summer, Waze rolled out its first flirtation with Uber’s turf: A trial in Tel Aviv that lets Waze users pick up passengers along their commute routes. It has since expanded to a few suburbs around the city. A Waze rep would only share that the Google unit is “quite pleased with the results.”

Waze also insists that its trial is not like Uber — drivers aren’t making money, and the program is framed as a way for cities to tackle congestion problems. It’s a key framing. When governments begin to approach autonomy, they are likely to turn to tech partners they know best.

Uber knows this. Recently the company has angled to position itself as a transit ally for officials, rather than a brash taxi basher. In the last two years, Uber has formed partnerships with several city transit agencies and governments, including Boston, but declined to share the full list.

Waze is not without hiccups. There’s the “Waze left” — the habit of the app steering drivers into hazardous turns. And some in LA voice frustration that the app has created more traffic issues, flooding drivers into unprepared neighborhoods, than solved them.

Marx, the LA official, doesn’t believe these issues as intractable. “Whenever you see technologies get introduced, and they’re changing people’s behavior, you’re seeing the inevitable friction that happens,” he said. “We expect to see innovations that we can’t just imagine yet.”