Get the user's height above ground level

I'm thinking about one game in real time. You need to get the user's height above ground level. If the coordinates can be obtained via the Google Location API, then how do I get the height, that is, the position on the Z-axis of the world space? Or is it already in the coordinates?

Author: DeKaNszn, 2017-10-23

2 answers

I thought I wouldn't find it, but the Google API has an Elevation API, of course. https://developers.google.com/maps/documentation/elevation/intro?hl=ru

 4
Author: , 2018-08-29 17:24:56

To get the height of the GPS receiver above sea level, use Location.getAltitude() (don't forget to check first that hasAltitude() returns true)
To get the ground level above sea level at a given point, you can use Elevation API
You can subtract the second from the first and get what you need, but keep in mind that any GPS receiver outputs data with an error of +

 2
Author: DeKaNszn, 2017-10-23 11:50:22