Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8241109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T20:43:28+00:00 2026-06-07T20:43:28+00:00

I’m testing an Android app that records the location (lat/long/alt). I’m running the app

  • 0

I’m testing an Android app that records the location (lat/long/alt). I’m running the app on a Samsung GTS5830 phone running Android 2.2.1

I read here and there that GPS altitude is often incorrect due to the earth not being perfectly spherical. At my location, for example, the geoid’s height is 52 meters.

My understanding is that this height would be substracted from a “pure” GPS altitude. This would make sense for my location as:

 - altitude from GPS phone: 535 m
 - geoid altitude: 52 m 
 - altitude from phone's GPS minus geoid height: 482m

 - correct atlitude: 478 m 

482 is close enough to the real thing for me to track elevation when hiking

  1. Is the above formula of the GPS height minus the geoid’s height correct?
  2. Am I correct to assume that android is not factoring in the geoid’s height when returning the GPS altitude?
  3. If the above is true, does it hold for all versions of Android?

Here is the code I use to obtain the GPS coordinates:

public class HelloAndroid extends Activity {

    @Override
    public void onCreate(Bundle savedInstanceState) {
        Log.d("main", "onCreate");
        setupGps();
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
    }

    LocationListener locationListener;
    LocationManager lm;

    void setupGps() {
        Log.d("gps", "Setting up GPS...");
        locationListener = new MyLocationListener();
        lm = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
        lm.requestLocationUpdates(LocationManager.GPS_PROVIDER, 20000, 5,
                locationListener);

        Log.d("gps",
                "GPS supports altitude: "
                        + lm.getProvider(LocationManager.GPS_PROVIDER)
                                .supportsAltitude());
        Log.d("gps", "Finished setting up GPS.");
    }

    static class MyLocationListener implements LocationListener {

        public void onLocationChanged(Location location) {
            Log.d("gps", "long: " + location.getLongitude() + ", lat: "
                    + location.getLatitude() + ", alt: "
                    + location.getAltitude());
        }
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-07T20:43:30+00:00Added an answer on June 7, 2026 at 8:43 pm

    The answers to all three of your questions are yes.

    The altitude you get from GPS is the height above the WGS84 ellipsoid in metres, which is an approximation of the earth’s surface. I know that because I’ve been developing Android software to use it.

    A correction has to be applied to convert the figure to height above mean sea level, or altitude as it is usually known. Note that this may differ from the altitude reported by an altimeter set to the current pressure at mean sea level because an altimeter actually measures air pressure, but air pressure is not just a function of height; it is also a function of air density and temperature, so an altimeter shows an approximation. This effect is not seen with GPS.

    The Earth Gravitational Model 2008 (EGM2008) maps the difference in mean sea level with the ellipsoid as a function of longitude and latitude. Details are here:

    http://earth-info.nga.mil/GandG/wgs84/gravitymod/egm2008/egm08_wgs84.html

    A less accurate model that uses less data called EGM96 is also available. Google both of these to understand these better.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I am doing a simple coin flipping experiment for class that involves flipping a
We're building an app, our first using Rails 3, and we're having to build
I am currently running into a problem where an element is coming back from
I need a function that will clean a strings' special characters. I do NOT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.