GPS Altitude error

623 views
Skip to first unread message

David Stanley

unread,
Jun 15, 2018, 3:58:29 AM6/15/18
to Osmand
Android 7 on Xperia XA and OSMAND 3 - 3.04

Recently I have been observing a substantial altitude error shown in OSMAND.  I know all about the reduced accuracy of altitude from GPS, so I do not need any advice about that!  In my area, OSMAND is showing the altitude as around 50m less than the true altitude above sea level.  My home is around 50-60m ASL, but in the garden OSMAND will show a negative altitude.  Using GPSTEST, it will show the correct altitude (near enough) if 'Use GeoID' is set to off and matches OSMAND if 'Use GeoID' is on.  I have only seen this since the OSMAND version 3.  I was also affected by the intermittent GPS fix bug that was fixed in 3.04.  Is anyone else seeing this?  has there been a change in this part of OSMAND since V3?  I did read somewhere of a bug in another GPS app where it incorrectly applied geoid to data that already had it applied.  Maybe it is the same issue here?

Poutnik the Wanderer

unread,
Jun 15, 2018, 4:31:42 AM6/15/18
to osm...@googlegroups.com
From the below description
it seems the GPStest has the same problem, giving correct value when it
should not and vice versa.


It looks like if OS, by itself or by interference of some GPS utility,
returns already corrected altitude,
and both OSMAnd and GPS test perform double correction.


BTW, it is a geoid, a term used for an irregular rotational ellipsoid, not
a GeoID.

----------
Dne 15. června 2018 9:58:33 David Stanley <da...@dbsconsult.co.uk> napsal:

> Android 7 on Xperia XA and OSMAND 3 - 3.04
>
> ...... In my area, OSMAND is showing the
> altitude as around 50m less than the true altitude above sea level. My
> home is around 50-60m ASL, but in the garden OSMAND will show a negative
> altitude. Using GPSTEST, it will show the correct altitude (near enough)
> if 'Use GeoID' is set to off and matches OSMAND if 'Use GeoID' is on. the
> Google Groups "Osmand" group.



David Stanley

unread,
Jun 15, 2018, 5:20:03 AM6/15/18
to Osmand
I know it is geoid, but GPS Test writes it as GeoID.  I just dug out my old phone which is a Xperia SP with Android 4.3.  it had OSMAnd 2.9.3 on it.  That showed the altitude as over 100m.  meanwhile GPS test showed the correct altitude, but this time with 'Use geoid' enabled.  Upgrading OSMAnd to 3.04 did not change the behaviour.  So it looks like OSMAnd is getting it wrong on both.  It would be good if using geoid could be an option somewhere in OSMAnd.

Greg Troxel

unread,
Jun 15, 2018, 10:18:02 AM6/15/18
to David Stanley, Osmand
David Stanley <da...@dbsconsult.co.uk> writes:

> I know it is geoid, but GPS Test writes it as GeoID. I just dug out my old
> phone which is a Xperia SP with Android 4.3. it had OSMAnd 2.9.3 on it.
> That showed the altitude as over 100m. meanwhile GPS test showed the
> correct altitude, but this time with 'Use geoid' enabled. Upgrading OSMAnd
> to 3.04 did not change the behaviour. So it looks like OSMAnd is getting
> it wrong on both. It would be good if using geoid could be an option
> somewhere in OSMAnd.

I suggest that you install SatStat, which reports the value as received
from the API. (I think it's not in the Google store, but it is in
f-droid and you can build it yourself). It looks like geoid height in
the UK is about 50m. It's -29m around me (Boston). But, this is
probably not a gpstest issue so that may not be useful.

So if your orthometric height is 60m, your ellipsoidal height is around
110m. What value do you see in gpstest with geoid corrections off?

Around me, I see ~correct ellipsoidal height values in satstat (~30m
less than orthometric height), and also in osmand without the geoid
file. WIth the geoid file, osmand reports ~30m higher than satstat, and
thus approximately the correct orthometric height (meaning what people
mean when they say ASL). This is with osmand 3.0.3. I have not noticed
any changes from 2.8.x to 3, or indeed with any previous versions.

A very important thing is that the Android specification says that the
system returns meters above the WGS84 ellipsoid:

https://developer.android.com/reference/android/location/Location#getAltitude()

So I wonder if your phone is applying a geoid correction to what is
returned from getAltitude. If so, that seems wrong, and you could file
a bug report with the phone vendor :-) Or, OSMAnd could work around
broken ROMs by having a quirk list of OS/hardware somehow and on those,
assume the geoid calculation has already been done.

Or perhaps you could just uninstall the geoid file.

(OSMAnd itself should somehow label altitude with h or H, so that the
user knows which is shown, but probably few understand this and having
the geoid file loaded is the right approach. So I'll suggest adding
'h' in altitude if the geoid correction is not applied.)

Greg

David Stanley

unread,
Jun 15, 2018, 11:46:13 AM6/15/18
to Osmand
Hi Greg

Thanks for your reply.  I have installed SatStat.  It reported a height around 40m on the XA.  GPS test reports the same with geoid off and around -10m with it on.  You mentioned uninstalling the geoid file.  Maybe it is corrupt on my phone.  How would I uninstall or replace it?

Regards


Dave

Greg Troxel

unread,
Jun 15, 2018, 4:07:46 PM6/15/18
to David Stanley, Osmand
David Stanley <da...@dbsconsult.co.uk> writes:

> Hi Greg
>
> Thanks for your reply. I have installed SatStat. It reported a height
> around 40m on the XA. GPS test reports the same with geoid off and around
> -10m with it on. You mentioned uninstalling the geoid file. Maybe it is
> corrupt on my phone. How would I uninstall or replace it?

Thanks. I didn't really doubt GPS test, but I'm really sure satstat
does no processing on the values returned from the API.

So, your phone is reporting ~40m as height above ellipsoid from
getAltitude(). But, you said you are at ~50-60m ASL, and the
geographiclib oneline calculator (written by a hard-core geonerd) says
the geoid at 51.5N 0E (picking Greenwich :-) is 46m above the ellipsoid:

https://geographiclib.sourceforge.io/cgi-bin/GeoidEval?input=51.5+0&option=Submit

so, your ellipsoidal height should be ~96-111m. The value of ~40m is
not so far off from your 50-60m. It is thus pretty clear that your
phone OS is applying the geoid adjustment -- which is incorrect per the
android specs.

So, there is no reason to think the osmand geoid file is buggy, but you
are best off removing it, so osmand does apply the correction. While
osmand applying it is correct, it's better to not apply it and have a
counterbalancing error to the phone incorrectly applying it :-)

To remove it, just select "Download Maps", and look for it in "All
Downloads" under World Maps. It is labeled "World Altitude Correction"
(which is not right; ellipsoidal vs above-geoid height is not an error),
and the three dots at right has "Remove".

Or you can go to your map directory with a file manager and look for and
remove:
World_altitude_correction_WW15MGH.extra

David Stanley

unread,
Jun 16, 2018, 12:25:39 PM6/16/18
to Osmand
Hi Greg

Thanks again.  I have uninstalled the osmand geoid file.  That has brought the OSMAnd reading into line with SatStat.  However, I am getting some very odd altitude readings on the phone.  One minute is about right, next it shows -50m.  So something is not right.  The position is always spot on though.  It may be time to try a full factory reset on it.  Not a fun thought having to reinstall everything though.

Regards


Dave
Reply all
Reply to author
Forward
0 new messages