Notices


Reply
Thread Tools
Posts: 1,399 | Thanked: 6,419 times | Joined on Apr 2010 @ Czech Republic
#31
Looking on how modRana does it (warning: modRana does some extra stuff there so the code is ore complex than necessarily needed) & trying to remember how I programmed it:
  • the PositionSource element has a coordinate property, which holds the current coordinate
  • the coordinate has a isValid property, which is used by modRana to decide if the coordinate is valid and should be used
  • to differentiate between 2D and 3D fix, modRana uses the altitudeValid property of the PositionSource instance

That seems to work reasonably well.

But it also depend how you define "has a fix" as by default the location backend on Sailfish OS first uses data from the mobile network and WiFi to get a rough position estimate while getting and actual GPS lock.

This is why you might see you position jump every 30 seconds for tens or hundreds of meters before it actually starts to track you position. It's the location backend sending data about local WiFi access points every 30 seconds to estimate your position while GPS is still acquiring the GPS lock.

The Info -> Location page in modRana displays detailed location data and you can nicely see the location converge from WiFi estimation to GPS fix there.
__________________
modRana: a flexible GPS navigation system
Mieru: a flexible manga and comic book reader

Thanks to everyone who voted for modRana & Mieru in the Maemo.org coding competition !
 

The Following User Says Thank You to MartinK For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 21:11.