I am coding a Fitness tracking App right now. Therefore I want to use the Altitude. I know I can get the Altitude via GPS, but this seems far away from being accurate. I already tried my app on several devices and all of them had problems with their altitude. Thanks for your help.
Asked
Active
Viewed 385 times
0
-
"this seems far away from being accurate" -- how have you determined this? – CommonsWare Jun 07 '20 at 22:16
-
Well as I said I used the app on my device and I know at which Altitude I live, and the Phone was about 70 meters off... But when I use the strava fitness app the altitude is way better, so it must be possible somehow. – ebtjan Jun 07 '20 at 22:22
-
Without a [mcve] demonstrating how you have found the altitude, it will be difficult for anyone to help you. – CommonsWare Jun 07 '20 at 22:25
-
GPS is terrible for altitude in this context. Use the pressure sensor if you have one for the best you can get off a phone but there are limitations and you need a calibration strategy. Fallback to online lookup or get the appropriate .dem files. – Ifor Jun 09 '20 at 13:24
1 Answers
0
There seems to be a google maps api, Google Maps Elevation API, which seems to provide the data you need, but apparently it does need a billing account associated, not sure if thats a possibility. But I would expect a company like Strava to use something like this, it seems pretty legit and accurate.
You make request:
https://maps.googleapis.com/maps/api/elevation/json?locations=39.7391536,-104.9847034&key=YOUR_API_KEY
and get something like this JSON back:
{
"results" : [
{
"elevation" : 1608.637939453125,
"location" : {
"lat" : 39.73915360,
"lng" : -104.98470340
},
"resolution" : 4.771975994110107
}
],
"status" : "OK"
}
https://developers.google.com/maps/documentation/elevation/start

sgtpotatoe
- 340
- 6
- 17