Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You algorithm looks correct.</p> <p>If you're wondering why you're not receiving a "zero" distance between two locations whose latitude and longitude look the same, you might not be considering enough significant digits when setting the latitude and longitude for your statically defined location. Having said that, six decimal places usually enough to get within a foot. (See <a href="http://en.wikipedia.org/wiki/Wikipedia%3aWikiProject_Geographical_coordinates#Precision" rel="nofollow">Precision Guidelines</a> in the _ Wikipedia:WikiProject Geographical coordinates._)</p> <p>While, in practice, it will probably never be zero (and certainly not reliably better than your location's <a href="https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocation_Class/CLLocation/CLLocation.html#//apple_ref/doc/uid/TP40007126-CH3-SW5" rel="nofollow"><code>horizontalAccuracy</code></a>), if you specify enough significant digits in your statically defined location, you should get closer than 15-20 feet.</p> <p>Also note, if you're using <code>CLLocationManager</code> method <a href="https://developer.apple.com/library/ios/documentation/CoreLocation/Reference/CLLocationManager_Class/CLLocationManager/CLLocationManager.html#//apple_ref/doc/uid/TP40007125-CH3-SW2" rel="nofollow"><code>startUpdatingLocation</code></a>, the initial location you get is invariably not the best value to use, as if you specify <code>desiredAccuracy</code> of <code>kCLLocationAccuracyBest</code>, it will often take a couple of calls to your <code>didUpdateLocations</code> (often with increasing accuracy, i.e. a decreasing <code>horizontalAccuracy</code>). So keep monitoring the locations that are reported by <code>didUpdateLocations</code> until you get a <code>horizontalAccuracy</code> within a range that you think is acceptable (but don't ever expect to get a perfect accuracy, because that will never happen and it's subject to the physical environment of the device, too).</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload