Calculate distance?

Discussion in 'iOS Programming' started by arnieterm, Jan 13, 2009.

  1. macrumors regular

    Joined:
    Aug 28, 2008
    #1
    For an iphone application that communicates with a google datastore table containing co-ordinates [Latitude n Longitude]. For a given venue record as fetched from datastore table and iphone location [Lat n Long] as obtained from Core Location framework, can it be possible to calculate distance in miles between these two locations?
    The location values both in datastore as well as ones returned by iphone core location are all in double
    How can it be done?
    Thanks
    Arnieterm
     
  2. macrumors 65816

    Joined:
    Jun 29, 2007
    #2
    If you know the lat/lng you can use Location Manager to calculate the distance.

    Google CLLocationManager
     
  3. thread starter macrumors regular

    Joined:
    Aug 28, 2008
    #3
    I have seen the core location framework sample earlier but it is missing now. Can you tell me how to calculate distance?
    I am also searching for core location sample
     
  4. macrumors 65816

    Joined:
    Jun 29, 2007
    #4
    Go to XCode, Open up Documentation under the Help menu and type

    getDistanceFrom

    Read. I don't mean to be a jerk but if you can't figure out how to use the documentation when it's right there how can you expect to create a solid application?

    I'm teaching you to fish instead of giving you the fish. ;-)

    Either that or ask a specific question, not "show me how to do it".
     

Share This Page