swift - Calculate the quality of the GPS signal iPhone -


i developing application similar runtastic. have problem understand quality of gps signal. if understand need use property horizontalaccuracy don't understand range quality of signal can considered excellent, good, or no signal. can me ? have found several examples on internet when go apply values don't want. code:

dispatch_async(dispatch_get_main_queue()) {             //assign new image             if(newlocation.horizontalaccuracy < 0){                 //no signal                 self.qualitasegnale.text = "\(newlocation.horizontalaccuracy)";                 self.imagegps.image = uiimage(named: "gps_signal_ko");             }             else if(newlocation.horizontalaccuracy > 163){                 self.qualitasegnale.text = "\(newlocation.horizontalaccuracy)";                 self.imagegps.image = uiimage(named: "gps_signal_peer");             }             else if (newlocation.horizontalaccuracy > 48){                 self.qualitasegnale.text = "\(newlocation.horizontalaccuracy)";                 self.imagegps.image = uiimage(named: "gps_signal_peer");             }             else {                 self.qualitasegnale.text = "\(newlocation.horizontalaccuracy)";                 self.imagegps.image = uiimage(named: "gps_signal_ok");             }         } 

thanks availability.

vincenzo

so below 48 considered good. i'd below 10 excellent.

source: i've been messing similar stuff recently, , appears best reading can radius of 5 metres. consider 5 metres best possible reading @ point in time.

in addition to:

if(newlocation.horizontalaccuracy < 0){ 

i'd check:

func locationmanager(_ manager: cllocationmanager, didfailwitherror error: error) { 

because there going errors if horizontalaccuracy less 0.


Comments

Popular posts from this blog

PySide and Qt Properties: Connecting signals from Python to QML -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

scala - 'wrong top statement declaration' when using slick in IntelliJ -