tags:

views:

44

answers:

2

I am in need to get the direction of a person using IPhone GPS. Direction means where the person is heading. If he is heading towards North then it should say North or otherwise South, West, East any one out of these four.

Is there a way to get this value?

Added September 02, 2010


I just got that Magnetometer can help what I am looking of. But it raise another question to me. Lets assume you are on a street which goes just straight (either North or South). Dividing that street in two places as the right most (west) and the left most (east). Is there a way to get which part the person is located?

+1  A: 

The iPhone 3GS brings a magnetometer:

http://stackoverflow.com/questions/834117/how-to-build-a-compass-with-the-iphone

karlphillip
thanks for your help. I edited the question can you please comment one this?
Umair Ashraf
+2  A: 

From http://developer.apple.com/iphone/library/documentation/CoreLocation/Reference/CLLocationManager_Class/CLLocationManager/CLLocationManager.html

Configuring Heading-Related Services

In iOS, a device with the appropriate hardware may also report heading information. When the value in the headingAvailable property is YES, you can use a location manager object to retrieve heading information. To begin the delivery of heading-related events, assign a delegate to the location manager object and call the location manager’s startUpdatingHeading method. If location updates are also enabled, the location manager returns both the true heading and magnetic heading values. If location updates are not enabled, the location manager returns only the magnetic heading value. These features are not available in Mac OS X.

More details at the link above.

Dan Ray
thanks for your help. I edited the question can you please comment one this?
Umair Ashraf
Re your edit--If I were you, I'd explore the geolocation services offered at http://www.geonames.org. They offer free web-request access to lots of geolocation and mapping, might provide pretty much what you're after.
Dan Ray