meetpd
meetpd

Reputation: 9219

How to measure Elevation using GPS technology for iPhone SDK?

There are few apps like Strava which records users movements using GPS. It also measures the elevation of the road on which they travelled.

I would like to know how can we measure elevation of the road using iPhone SDK?

Please let me know.

Upvotes: 1

Views: 2164

Answers (2)

craig1231
craig1231

Reputation: 3867

Use the Google Elevation API

Example here

Then use a JSON parser to retrieve the values

Upvotes: 3

Nightfa11
Nightfa11

Reputation: 141

CoreLocation is what you want to use (although it is generally quite inaccurate I've found) first import the core location framework in the .h:

#import <CoreLocation/CoreLocation.h>

followed by in the .m:

- (void)locationUpdate:(CLLocation *)location {

altitudeLabel.text = [NSString stringWithFormat:@"Altitude - %f", [location altitude]];
}

This is given in height from sea level

Upvotes: 0

Related Questions