Best way to get the current location?

What is the best way to get a current location reliably? 

Now I get the location from:

  1. Toybox.Position if available
  2. Toybox.Activity otherwise
  3. Toybox.Weather.getCurrentConditions().weather.observationLocationPosition if available

In what occassions are the above possitions accurate/outdated?

From my observation the only location being updated by a phone location is the Weather location. 

One user reported that this approach don't work on F6 16.10 beta, while it works reliably on stable releases on all devices. 

Is there a better approach? 

What did change on F6 16.10 beta? 

  • If you want CURRENT LOCATION you have obtain it from Position of course (call and wait for response) but  I guess Position is not available for watch faces.

    In my wf I obtain it from Toybox.Activity, but it is a "little" complicated, you have to save it because not always it's available and than I use saved position.

  • Good point. I'm asking to get the location reliably whenever it is possible to give users information from around his location (like sunrise/sunset and 24h hourly weather forecast (that Garmin does not provide by API)), and therefore I'd accept an approximate location from a phone as well. 

    The problem with Position is that it's updated only by GPS of the watch, and not if the user is e. g. commuting back from the trip by car. A user also might not confirm permissions needed for watch to return it. 

    The problem with Activity is, it's the position of last activity, not where the user is now. 

    The disadvantage of Weather is that it is not accurate (although by my tests its typically 1 km around, so it doesn't matter for my case above). Sadly, sometimes the watch doesn't update even this location.

    Yet this sequence is the most reliable process to get a location I found. Anybody found anything better? 

    PS: the mentioned problem on  F6 16.10 beta was on my side. Probably no difference there.

  • The most accurate way to get the user's location is to start up GPS on the device.  You can do this in widgets and device apps, but not watch faces.

    Without GPS, both Position and Activity, will at best show the last location when GPS was used, though the data can go stale after a time.

    If the location is off, the best you can do is ask the user to start an activity that uses GPS, wait for a GPS fix, and then return to your watchface.

    If you use Weather and observationLocation, that should be fairly accurate as of the last time GCM requested the weather and it was seen by the Garmin device.  However, for Andriod GCM, this seems to be at best every 20 minutes, while with iOS GCM, seems to be about every hour.

  • I'm not looking to the most accurate, but I'm looking for the most reliable way of getting a position regardless of what user does. 
    So the Weather seem to be closest to the goal. It just has problems of its own: forums.garmin.com/.../weather-forecast-location-gets-updated-only-by-activity

  • I put together a test widget months ago, where on a map, I show the current location based on GPS, as well as the location from Weather, and they are generally close to each other (like 50 feet).  I'll try it again without starting GPS and just watch the location from weather.

  • Great: the problem for me appeared when I commute back just by car without walking activity detected by watch as described in the bug above. 
    It would be great to learn what's your observation in such scenario. Thanks

  • Bear in mind that what's best for you might not be the best for everyone.  By that I mean with Garmin Weather, the data could still be an hour or more old (you can check observationTime), or if you are using a different weather provider, the data might also be old or from a distance away.  For me with OWM, the two closest reporting stations are over 10 miles away and at at a different elevation, so even with my exact location and fresh data, could look wrong.

  • Do you want gps position for watch face?

  • I've just reflected on why my watch face run well. :)
    - wf - no activity, reading saved value in previous sesion
    -start activity (wf exit, only exist background process)
    -end activity, return to watch face and I have got actual position - why?
    In previous version background process read position but I've moved this code to view and still run - because there is valid gps after few moment after finish activity?

  • Position data is even worse. 

    It can stay days in a position of the last activity even though the Weather location now knows you are elsewhere. 

    It's OK that Toybox.Activity give the location of the last activity. 

    But I don't think anybody needs that from Toybox.Position. Why would I want from it a position of the last  activity if I can have it from Toybox.Activity and not the current position?