# Does GPS speed takes altitude into account and finding the slope of a hill ?

**URL:** <https://boards.straightdope.com/t/does-gps-speed-takes-altitude-into-account-and-finding-the-slope-of-a-hill/854446>\
**Category:** Factual Questions\
**Created:** [May 25, 2020, 4:22pm UTC](https://boards.straightdope.com/t/does-gps-speed-takes-altitude-into-account-and-finding-the-slope-of-a-hill/854446 "2020-05-25T16:22:10Z")\
**Posts on this page:** 12\
**Page:** 2

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [May 27, 2020, 2:56pm UTC](https://boards.straightdope.com/t/does-gps-speed-takes-altitude-into-account-and-finding-the-slope-of-a-hill/854446/21 "2020-05-27T14:56:01Z")

</div>

Well, yes, in the middle of a forest, obviously the WiFi data won’t be available. That’s part of the reason why they use multiple data sources. But most people spend most of their time in cities, where WiFi networks (and specifically, WiFi networks that are usually on and stay in the same place) are abundant.

And even if you had perfect data in all three dimensions, it might still make sense to show only the two-dimensional projection of velocity, because you care about velocity on maps which are two-dimensional.

---

<div class="post-metadata">

**Author:** ![DesertDog](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/desertdog/32/11503_2.png) [@DesertDog](https://boards.straightdope.com/u/DesertDog)\
**Post date:** [May 27, 2020, 3:14pm UTC](https://boards.straightdope.com/t/does-gps-speed-takes-altitude-into-account-and-finding-the-slope-of-a-hill/854446/22 "2020-05-27T15:14:41Z")

</div>

> [@smithsb](#):
>
> Are you talking about the Lincoln Navigator (big suv)? Altimeters need calibrating for air pressure. Not sure if the car even has allowance for it. Airline pilots get the local pressure when landing to correct readings.

No, there was no uppercase N when I said navigator. I was talking about a Magellan and when that died, the Garmin that replaced it. Neither AFAIK measures air pressure nor emits radar – doppler or otherwise.

---

<div class="post-metadata">

**Author:** ![EdelweissPirate](https://avatars.discourse-cdn.com/v4/letter/e/8491ac/32.png) [@EdelweissPirate](https://boards.straightdope.com/u/EdelweissPirate)\
**Post date:** [May 27, 2020, 7:19pm UTC](https://boards.straightdope.com/t/does-gps-speed-takes-altitude-into-account-and-finding-the-slope-of-a-hill/854446/23 "2020-05-27T19:19:51Z")

</div>

> [@Chronos](#):
>
> Well, yes, in the middle of a forest, obviously the WiFi data won’t be available. That’s part of the reason why they use multiple data sources.

I’m not quite sure if you’re referring to one of my comments, but I was just trying to illustrate the very low power of GPS signals—that even leaf cover can cause problems.

I neglected to mention that my GPS bike computer was functioning in a “pure” GPS mode with no snap-to-map stuff happening. It has neither wifi nor cellular radios, so those weren’t a factor either. I believe we’re making pretty much the same point.

> [@DesertDog](#):
>
> I was talking about a Magellan and when that died, the Garmin that replaced it. Neither AFAIK measures air pressure nor emits radar – doppler or otherwise.

The Doppler measurements mentioned here have nothing to do with radar—it’s a shift in the frequency of the GPS signals themselves.

GPS satellites emit their signals are at a known and very consistent frequency. If the receiver sees a slightly higher frequency than the known one, you’re traveling towards that satellite. If the frequency is lower than expected, you’re moving away from it.

No radar required!

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [May 27, 2020, 7:23pm UTC](https://boards.straightdope.com/t/does-gps-speed-takes-altitude-into-account-and-finding-the-slope-of-a-hill/854446/24 "2020-05-27T19:23:17Z")

</div>

That was mostly responding to **Steven\_G** ’s post. The GPS might be less useful in a thick forest, but WiFi won’t work there at all, so WiFi definitely isn’t the phone’s primary information source there.

---

<div class="post-metadata">

**Author:** ![EdelweissPirate](https://avatars.discourse-cdn.com/v4/letter/e/8491ac/32.png) [@EdelweissPirate](https://boards.straightdope.com/u/EdelweissPirate)\
**Post date:** [May 27, 2020, 7:27pm UTC](https://boards.straightdope.com/t/does-gps-speed-takes-altitude-into-account-and-finding-the-slope-of-a-hill/854446/25 "2020-05-27T19:27:56Z")

</div>

Ah! My mistake! Thanks for clarifying.

---

<div class="post-metadata">

**Author:** ![Corry\_El](https://avatars.discourse-cdn.com/v4/letter/c/ecae2f/32.png) [@Corry\_El](https://boards.straightdope.com/u/Corry_El)\
**Post date:** [May 27, 2020, 7:42pm UTC](https://boards.straightdope.com/t/does-gps-speed-takes-altitude-into-account-and-finding-the-slope-of-a-hill/854446/26 "2020-05-27T19:42:47Z")

</div>

> [@smithsb](#):
>
> Are you talking about the Lincoln Navigator (big suv)? Altimeters need calibrating for air pressure. Not sure if the car even has allowance for it. Airline pilots get the local pressure when landing to correct readings.

It was clarified other comment referred to an add-on device but my old Lexus GX470 has this built in with easy display (my newer car might also have it buried in some menu but I’ve never looked at it). I live basically at sea level but it gives varying non-zero readings around home, maybe +/-50-150’. Since it’s not always off in the same direction there seems little point calibrating it. It’s useful as a general indicator in parts of the country where road altitude varies significantly over a few hours drive, which around here it basically doesn’t.

If this were to be used as input to correct for vertical component of speed (which I’m almost sure it isn’t) it wouldn’t necessarily be useless because off that much, as long as the error was around the same at different altitudes in given conditions.

Anyway as others said, even on very steep roads (10% grade was mentioned but for example on Interstates 6% is the general max, and pretty rare) the error introduced by vertical component is probably smaller than the one between the mechanical speedometer and GPS based speed. Since I sometimes drive a bit fast in my other car I’ve made it a point to measure the accuracy of the speedometer and it overstates speed a few mph at high speed, a fairly big error.

---

<div class="post-metadata">

**Author:** ![Pleonast](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/pleonast/32/1183_2.png) [@Pleonast](https://boards.straightdope.com/u/Pleonast)\
**Post date:** [May 27, 2020, 7:59pm UTC](https://boards.straightdope.com/t/does-gps-speed-takes-altitude-into-account-and-finding-the-slope-of-a-hill/854446/27 "2020-05-27T19:59:01Z")

</div>

> [@Chronos](#):
>
> I’m not sure what a phone would do if you gave it multiple input streams that all seem reliable, but which disagree significantly. Probably just throw out an error message that says “Location data lost. Searching.”, or something like that.

I assume modern smart phone have the computational resources to run a [Kalman filter](https://en.wikipedia.org/wiki/Kalman_filter) and do so. You can read the Wikipedia for the full explanation, but in simple terms, a Kalman filter takes a series of measurements with error estimates and combines them to get the statistically best estimate of those measurements. Measurements with higher error estimates are given less weight than those with lower. Furthermore, you can include knowledge like “the rate of change of the position measurements should be the same as the velocity measurements”.

---

<div class="post-metadata">

**Author:** ![Pleonast](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/pleonast/32/1183_2.png) [@Pleonast](https://boards.straightdope.com/u/Pleonast)\
**Post date:** [May 27, 2020, 8:13pm UTC](https://boards.straightdope.com/t/does-gps-speed-takes-altitude-into-account-and-finding-the-slope-of-a-hill/854446/28 "2020-05-27T20:13:26Z")

</div>

> [@Pleonast](#):
>
> Furthermore, you can include knowledge like “the rate of change of the position measurements should be the same as the velocity measurements”.

Forgot to add, this is why a GPS speed estimate is generally better than the position estimate—because there’s two stream of measurements (range-rate and Doppler) that can be used to estimate it. If you’re estimating distance traveled from a known position, you can go the other way as well, using the velocity measurements to improve your position estimate. That is why good position measurements (from WiFi, for example) are very important.

A good Kalman filter will take all the different measurements into account. The accelerometer measurements will improve both the velocity and position estimates in a similar way.

---

<div class="post-metadata">

**Author:** ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)\
**Post date:** [May 27, 2020, 10:57pm UTC](https://boards.straightdope.com/t/does-gps-speed-takes-altitude-into-account-and-finding-the-slope-of-a-hill/854446/29 "2020-05-27T22:57:36Z")

</div>

Well, yes, but if you’ve got one input stream that says “Velocity 11.2 m/s ± 0.3 m/s”, and another input stream that says “Velocity 31.6 m/s ± 0.2 m/s”, the correct action is not just to assume that the velocity is 23.36 m/s (what you would get just from the weighted average of those two numbers). The correct action is to realize that those measurements are impossible, and to conclude that at least one of the two input streams is malfunctioning, and not trust any number until you can determine which one.

---

<div class="post-metadata">

**Author:** ![Pleonast](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/pleonast/32/1183_2.png) [@Pleonast](https://boards.straightdope.com/u/Pleonast)\
**Post date:** [May 28, 2020, 1:20am UTC](https://boards.straightdope.com/t/does-gps-speed-takes-altitude-into-account-and-finding-the-slope-of-a-hill/854446/30 "2020-05-28T01:20:08Z")

</div>

> [@Chronos](#):
>
> Well, yes, but if you’ve got one input stream that says “Velocity 11.2 m/s ± 0.3 m/s”, and another input stream that says “Velocity 31.6 m/s ± 0.2 m/s”, the correct action is not just to assume that the velocity is 23.36 m/s (what you would get just from the weighted average of those two numbers). The correct action is to realize that those measurements are impossible, and to conclude that at least one of the two input streams is malfunctioning, and not trust any number until you can determine which one.

A Kalman filter is answering the question “what’s the best estimate of this quantity”. It would end up with a velocity estimate between the two with an error estimate large enough to encompass both measurement streams. Which is basically a quantification of your answer. 😃 It’ll capture the state of knowledge (or lack thereof) quite well. Broadly, while the error of our velocity estimate is large, we do know that velocities between the measurements are more probable than those outside them.

Or, as I’ve heard said: garbage in gives garbage out, but just how stinky is the garbage? :eek:

---

<div class="post-metadata">

**Author:** ![Steven\_G](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/steven_g/32/5080_2.png) [@Steven\_G](https://boards.straightdope.com/u/Steven_G)\
**Post date:** [May 28, 2020, 9:01am UTC](https://boards.straightdope.com/t/does-gps-speed-takes-altitude-into-account-and-finding-the-slope-of-a-hill/854446/31 "2020-05-28T09:01:27Z")

</div>

> [@Chronos](#):
>
> That was mostly responding to **Steven\_G** ’s post. The GPS might be less useful in a thick forest, but WiFi won’t work there at all, so WiFi definitely isn’t the phone’s primary information source there.

And I knew you knew that, my comment was an apparently poor attempt at gentle humour.

While WiFi and mobile use to download accurate information can be extremely helpful e.g. for this GPS-known position (long/lat) the national survey says you must be at x meters elevation. Of course if up in a balloon or down a mineshaft\*, it might still not be right!

Use of WiFi/mobile signals for triangulation (using signal strength) to determine position is not very accurate either, even in a city. Probably only gets you with a hundred meters or so as the signals can be very variable and also if repeaters are used, position is not precise at all.

- I know GPS won’t work in a mine

---

<div class="post-metadata">

**Author:** ![DPRK](https://avatars.discourse-cdn.com/v4/letter/d/4491bb/32.png) [@DPRK](https://boards.straightdope.com/u/DPRK)\
**Post date:** [May 28, 2020, 9:28am UTC](https://boards.straightdope.com/t/does-gps-speed-takes-altitude-into-account-and-finding-the-slope-of-a-hill/854446/32 "2020-05-28T09:28:18Z")

</div>

> [@Pleonast](#):
>
> A Kalman filter is answering the question “what’s the best estimate of this quantity”. It would end up with a velocity estimate between the two with an error estimate large enough to encompass both measurement streams. Which is basically a quantification of your answer. 😃 It’ll capture the state of knowledge (or lack thereof) quite well. Broadly, while the error of our velocity estimate is large, we do know that velocities between the measurements are more probable than those outside them.

Forget about Kalman filtering for a moment. I have to agree with **Chronos** here that, given the measurements he describes, the best estimate of the velocity is that you have no idea, because something has gone horribly wrong. Aeroplanes have gone down because of a lack of triple redundancy.

[Previous page](https://boards.straightdope.com/t/does-gps-speed-takes-altitude-into-account-and-finding-the-slope-of-a-hill/854446.md?page=1)
