IOS positioning accuracy

Source: Internet
Author: User

time 2015-03-19 18:30:59 Turing community

Since iOS does not have direct control over GPS, we generally use Cllocationmanager to obtain geolocation information and we use

kCLLocationAccuracyBest;

To request the most accurate geo-location information. But there was a time when the geographic information requested was very biased.

It is not the problem of error, it is the problem that can not be used completely. CLLocationthere is actually an horizontalAccuracy attribute that we can use to control the accuracy problem. For example, we require a precision of 200 meters, we can write:

- (void) Locationmanager: (Cllocationmanager *) Lmanager didupdatetolocation: (cllocation *) newlocation fromLocation: ( Cllocation *) oldlocation{ if (newlocation. Horizontalaccuracy  < 200 && newlocation.horizontalaccuracy! =-1" {  //many many code Here...} else {  [Lmanager stopupdatinglocation]; span class= "comment" >//stop getting   [Nsthread Sleepfortimeinterval:10"; //blocked 10 seconds   [Lmanager Startupdatinglocation];//retrieve }          

CLLocationThe horizontalAccuracy attribute accuracy is meters, when the value is 1, the position is not trusted, so we can filter out the non-conforming data in this way, and ask for geo-location information.

IOS positioning accuracy

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.