(Photo by Adam Berry/Getty Images)

Every time Uber gives a ride, it collects several notable pieces of data: the location where a car picked you up, the time of day, the location of your destination, and the time it took you to get there. Add up thousands of trips, and contained in that data are some even more interesting patterns: Uber knows when and where travel demand spikes on a Saturday night, how long it takes to cross town during rush hour, which neighborhoods need service that cabs cannot satisfy.

Uber, in fact, probably knows some of these patterns better than many cities do — which is why cities are eager to have this data. Thus far the company has held it close. But Tuesday Uber is announcing plans to share its data more broadly with local governments in a gesture that's both an act of good will and a bid for good press after a rough few months of criticism.

The company plans to partner first with Boston, sharing quarterly anonymized trip-level data with the city in a model that Uber says will become its national data-sharing policy. The data will include date, time, distance traveled and origin and destination locations for individual trips, identified only by zip code tabulation area to preserve privacy. Once held by cities, this information will be open to records requests, meaning that the public (and researchers) will have access to it, too.

Such data could help cities keep tabs on Uber and, for example, which neighborhoods the company is serving. Uber says, though, that it's primarily offering the data so that cities can better understand themselves.

"The data we’re going to provide will help cities manage growth, relieve traffic congestion, expand public transit, fill potholes," says Justin Kintz, Uber's head of policy for North America.

Uber has been reluctant to turn over data to regulators -- it has recently clashed with New York City and the California Public Utilities Commission over reporting requirements. In its defense, Uber has cited the privacy of its users and the intellectual property that might be gleaned from its data.

Now, Kintz says, the company believes it can protect consumers by stripping personally identifiable information from trips, and by identifying pick-up and drop-off locations only by zip code. The Census Bureau often releases data using this same geography.

Jules Polonetsky, the executive director of the Future of Privacy Forum, was briefed by Uber on its data-sharing plans, after he reached out in the fall with concerns about the company's earlier privacy missteps. Monday night he said he believed that zip codes offered a large enough geography to protect individual users.

In November, Uber was broadly criticized by privacy advocates after a top executive suggested that the company had the power to investigate the private lives of journalists. In the past, Uber has also used trip data to analyze what appeared to be one-night stands by users, and one official in New York tracked the travel of a BuzzFeed reporter, suggesting that the company did not tightly control how its own employees access user data.

By offering to publicly share a much broader dataset, Uber is trying to demonstrate that it can be a responsible steward of the vast information it now controls — and that data many have associated until now with privacy concerns might also be leveraged for public good. Uber even says it will help cities interpret the data, where they lack the kind of analytical expertise that tech companies possess.

"We want what’s best for cities," Kintz says. "The more cities can invest in themselves, invest in improving ways people can get around the city safely, conveniently, affordably, then Uber’s going to benefit, too, over the long haul."

Cities use data about travel patterns to plan future infrastructure investments, or to prioritize service. This data could tell cities how fast traffic is moving at certain times of day, or whether Uber itself is contributing to lower congestion, or less parking demand. Governments could pair Uber's data with their own information about transit availability, for instance. Do Uber riders call the service more often when there's no good transit alternative around?

This data certainly won't tell cities everything they want to know. Uber's users aren't representative of the full population in any metro area. Uber also isn't offering to hand over its pricing data, which could reveal how much residents are willing to pay for better transportation, and whether the service is affordable to lower-income residents. But, for transparency advocates who've long wanted to see more of Uber's own information, Tuesday's announcement is a big step.

For the company's part, the gesture is also a savvy one. Regulators are increasingly pressing Uber for data. By devising its own national data-sharing proposal, Uber is setting its own terms for a policy that likely would have come anyway. If this data turns out to be as valuable to cities as Uber suggests, the company may have also just found another way to argue its case in cities that have remained hostile to the company.

"I hope that by showing the kinds of benefits we could bring to cities," Kintz says, "by showing we’re able to help reduce congestion and help reduce parking and help improve the flow of residents around the city, it’s going to make other cities as willing to embrace ridesharing and embrace Uber as you've seen in Washington and Boston."