1

I use the longitude and latitude of any location to get the elevation using Google elevation API.

https://developers.google.com/maps/documentation/elevation/

But it gives me illogical elevations for example I am in the second floor and it gives me 88 Meter

There is anyone have an explanation for this issue ?!

Menna-Allah Sami
  • 580
  • 4
  • 19
  • 1
    `There is anyone have an explanation for this issue`. Yes, you have bug(s) in your code. Please edit your question to include the **relevant** code. Please don't post all of your code, just the bits where you deal with the location and elevation. BTW, you do understand that the elevation is above sea level? 2nd floor means nothing without knowing the sea level elevation of the ground floor. – Simon Oct 20 '13 at 09:09
  • I am not start coding yet I just wanna know where I can start ! – Menna-Allah Sami Oct 20 '13 at 11:42
  • I get longitude and latitude from get altitude app from google play then use these values to to get the exact altitude from Google elevation API.. – Menna-Allah Sami Oct 20 '13 at 11:43
  • Yea,I know that. But it isn't my issue now I was asking if there is any measurement whatever which coordinates system it uses that is sensitive to building floors sorry for separated comments – Menna-Allah Sami Oct 20 '13 at 11:45

2 Answers2

2

The API you are looking at gives you ground level altitude based on a reference data set. It want be able to tell your on the second floor of a building. The best it will do is tell you is the altitude for the ground floor of the building.

If you want height above ground level then you could get something probably accurate to about +-0.5m on a phone with a pressure sensor but that would mean getting a reading at ground level and then at the level your interested in. There is a getAltitude(float,float) method you can use to get relative altitude at two points based off pressure readings. Without calibration the absolute altitude values will not be accurate but relative to each other they should be good. My testing shows I can see the difference just picking my xperia Active up off the desk with this setup with a bit of filtering on the raw pressure values.

Ifor
  • 2,825
  • 1
  • 22
  • 25
2

Am into this Elevation API recently So if am in right track what you get as 88 meter is the height of ground(where your building is) to sea level difference not the height from ground to second floor. you could use getAltitude() method for this but it gives you height from ellipsoid not from sea level and also it not much accurate you may have to do some calculations to correct the accuracy.

please see this question in SO the links suggested are this and thi

hope this helps you

Community
  • 1
  • 1
suja
  • 1,198
  • 2
  • 12
  • 32