# Android JSON Data interpretation

I got this data from my phone, most of it I generally understand, but some of the GPS positional values have me confused:

``````    "locations" : [ {
"timestampMs" : "1531422503855",
"latitudeE7" : 399187535,
"longitudeE7" : -751663977,
"accuracy" : 16,
"altitude" : -28,
"verticalAccuracy" : 2
}, {
"timestampMs" : "1531422474313",
"latitudeE7" : 399187554,
"longitudeE7" : -751664138,
"accuracy" : 16,
"altitude" : -28,
"verticalAccuracy" : 2
},
``````

Now I understand how to decipher most of this, the timestamp is in the epoch format, and the coordinates are a factor of 10^7. But basically, it's these the last three that have me confused. As I understand it, accuracy is defined as the radius of 68% confidence. So I'm assuming the value returned, 16 in this case, is that the GPS is 68% confident that it's accurate within 16 meters(?). But with the altitude and vertical accuracy values, I have NO idea. I know that Altitude accuracy for GPS is very inaccurate for many reasons, but I'm assuming this -28 is negative 28 meters below the sea level...? But to be honest, I'm not sure, along side vertical accuracy. If someone could give me the correct interpretation that would be much appreciated.

Second but small question, the phone recorded two GPS points within 30 seconds of each other, where the GPS basically recenters and gets a more accurate location, is it safe to assume that this second location is the "correct" location with how frequently the device polls the data?

It'd make sense that accuracy of 16 means there is a 68% chance of being within the circle of 16m radius centered on the reported latitude and longitude, as that's what Android’s getAccuracy() method returns. Similarly, the vertical accuracy (which is often 2 for me as well) would make sense as 68% of ±2m (from getVerticalAccuracyMeters). There isn't any documentation that I can find of the format, so it's hard to be sure.

GPS is normally less reliable in altitude than latitude/longitude, but a lot of phones (mine included) have barometric altimeters, which can give much more precise altitude if calibrated (which Google may be able to do from e.g., weather stations).

All that is well in theory, but looking at own Google Takeout data, it appears altitude is off by ~30m (way more than the ±2m it'd be claiming). [Update This is probably the difference between WGS84 altitude and MSL; see http://www.esri.com/news/arcuser/0703/geoid1of3.html for an explanation and http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm96/intpt.html for a calculator.] And is updated infrequently (it's been showing the same value for me for hours over a bunch of records, and given I haven't traveled anywhere, but you'd expect random variation if it were raw GPS numbers).

I wouldn't assume the correctness of any of this data. Keep in mind what it was gathered for — mostly for statistical aggregation to show you relevant places, ads, etc. None of that requires any given point to be correct. Indeed, in my history, I've got a few points which are accuracy of 1524304 — so, errr, 68% confident which quarter of the globe I'm in?

• Does the source of the gps data matter when it comes to supposed correctness/accuracy? This information came from say google maps/findmyphone/google timeline instead of a organic scheduled location update, with all of the GPS settings on with no battery saving options turned on when it comes to location data. Which would be actively polling data from the phone. – I am 126264. Sep 28 '18 at 23:39
• Also the phone that the data polled from was a Samsung Galaxy S8 which does have a barometer, among many other things that would help with accuracy of data as it is a flagship phone. – I am 126264. Sep 28 '18 at 23:42
• @Iam126264. Actively using the GPS probably results in a much more accurate reading vs the cell tower / Wi-Fi / Bluetooth / quick GPS it would otherwise use to save power. Also, I think I figured out why my altitude is off so much — it's not, different definition of 0 altitude, updated answer. – derobert Sep 29 '18 at 0:09
• I see, the +-30 makes more sense now. I guess this might be beyond the scope of both of us, but assume that say -30 is the "actual zero", where zero is the mean sea level which we will just assume to be true for this test case, where does that align with actual road infrastructure. Basically, when you use either the calculator or any other site that measures altitude given coordinates, and say they give you a value of 4 meters at said coordinates, is that from the actual street? Sidewalk? Entrance of the building if there is a building/house/structure? – I am 126264. Oct 2 '18 at 14:03
• @Iam126264. If you're using a site (or a topographic map) then that's telling you how high the ground is above sea level. That's going to be pretty approximate though, unless you actually find a survey marker. (Example: if I look at topographic maps for where I live, they haven't been updated since the 90s. My housing development hadn't been built yet, and the construction surely changed the topography.) – derobert Oct 2 '18 at 16:07