<=  Using Multiple dev.  

  Editing  =>

Sailor Logbook App (7.7)
Using Weatherfetch

Purpose of chapter: to illustrate how the Weatherfetch feature works and describe it's oppertunities and limitations.


Local TOC

Overview

As described in the TrackSet: Weatherfetch freq. Picker help screen:

The Weatherfetch (Wf) feature fetches data from a webservice at 'openweathermap.org' while tracking, by sending request over the Internet regarding the current:

which are then used to make regular, automatic events - like manual events created with the 'New event' action.

First request is approx. 5 minutes after start and after any change of frequency, and hereafter for each 'freq. amount of time' (plus a little extra).

Time evaluations occur when plots are made, i.e. Weatherfetch needs motion!

Network or other request errors gives a 'WEATHERFETCH PROBLEM' incident - but don't stop trying a next request.

All requests are on behalf of CoaSoft, i.e. your anonymity isn't compromised.

A walk in the snow

When the Weatherfetch feature was released, it was winter at our latitude, and therefore it wasn't an option to launch it in the sea. Instead a walk was done, after setting the Weatherfetch freqency to '15 min'. In the Tracklist it's listed as:

Weatherfetch, A walk in the snow

A walk in the snow, Map

Switching ON the MapSet: Show wind markers Switch and the MapSet: Show weather & waves icons Switch, the Map shows the walk as:

Weatherfetch, A walk in the snow, Map

Things to notice:

When Switching ON the MapSet: Show temp & visibility icons Switch instead, the Map displays:

Weatherfetch, A walk in the snow, Map

Things to notice:

A walk in the snow, Eventlist

On an imagined very tall iPhone, the Eventlist would appear as:

Weatherfetch, A walk in the snow, Eventlist

Things to notice:

The latter is because "Time evaluations occur when plots are made, i.e. Weatherfetch needs motion!".

A Weatherfetch event is an Autogenerated event - therefore it cannot be created before the GPS has fetched a location (a plot) for the event to attach to.

A timestamp is saved when a Weatherfetch event is made. Each time a next plot is made, it's examined if at least the specified 'freq. amount of time' (e.g. 15 minutes) has elapsed since then and if so, a next Weatherfetch event is created.

In other words: Weatherfetch event creation is not controlled by a timer, therefore their timing is only approximate.

A walk in the snow, Event editor

On a very tall iPhone, opening the Event editor from e.g. the third item in the list would look like:

Weatherfetch, A walk in the snow, Event editor

Things to notice:

Changing frequency

The TrackSet: Weatherfetch freq. Picker can be used without limitations to change frequency value.

When changed to value 'None' during tracking, a Wetherfetch stops! Toast message appears shortly.

When changed to any other value during tracking, this Toast message is shown:

Weatherfetch, Changing frequency

- whereafter Weatherfetch restarts, just as if the given value was set when tracking began.

Incidents

Communication is difficult! Sending requests for, or delivering and receiving data may cause a condition to be written to the Incidents log.

Checkout the Remarks on incident 'Weatherfetch problem'.

Transforming weather data

The Current weather data API at 'openweathermap.org' delivers information in formats that must be transformed to match those of the Sailor Logbook App.

Below a going through how each of the five pieces of information - input - is transformed.

In the following, the term set to is synonymous with transformed to.

Transforming weather data, wind direction

Input: Wind direction, degrees (meteorological), an integer number, absent or with values 0 - > 360

If absent, the wind direction in the App is set to -?- (meaning undefined).

Else transformation is done by simple splitting of the value into every other of the 32 points of a compass (N - nne - ... - nnw).

Wind direction nil (meaning defined, but no direction or still) is not possible here.

Transforming weather data, wind force

Input: Wind gust, meter/sec and Wind speed, meter/sec, two floating point numbers, each absent or with value 0.0 and above.

If both are absent, the wind direction as well as wind force in the App is set to -?- (meaning undefined).

Else, if wind direction was not set to -?-, a combined value is setup as either Wind gust (preferred if present) or Wind speed, and this value determines the wind force according to the Meter/sec column in the windforces table in Settings mainpage: Windforces Picker - except the < 0.5 m/s: Calm (nil) value is not possible here.

Transforming weather data, weather

Input: Weather condition 'ID', an integer number, absent or with three-digit values.

If absent or no matching entry can be found in the table below, weather text in the App is set to -?- (meaning undefined).

Else the Weather text in the App is setup from the ID code according to the table below, where the Main and the Description columns are defined by 'openweathermap.org':

ID Main Description Weather in App
200Thunderstormthunderstorm with light rain Thunder
201Thunderstormthunderstorm with rain Thunder
202Thunderstormthunderstorm with heavy rain Thunder
210Thunderstormlight thunderstorm Thunder
211Thunderstormthunderstorm Thunder
212Thunderstormheavy thunderstorm Thunder
221Thunderstormragged thunderstorm Thunder
230Thunderstormthunderstorm with light drizzleThunder
231Thunderstormthunderstorm with drizzle Thunder
232Thunderstormthunderstorm with heavy drizzleThunder
300Drizzle light intensity drizzle Grey sky
301Drizzle drizzle Grey sky
302Drizzle heavy intensity drizzle Drizzle
310Drizzle light intensity drizzle rain Drizzle
311Drizzle drizzle rain Drizzle
312Drizzle heavy intensity drizzle rain Drizzle
313Drizzle shower rain and drizzle Drizzle
314Drizzle heavy shower rain and drizzle Drizzle
321Drizzle shower drizzle Drizzle
500Rain light rain Rain
501Rain moderate rain Rain
502Rain heavy intensity rain Rain
503Rain very heavy rain Strong rain
504Rain extreme rain Strong rain
511Rain freezing rain Strong rain
520Rain light intensity shower rain Strong rain
521Rain shower rain Strong rain
522Rain heavy intensity shower rain Strong rain
531Rain ragged shower rain Strong rain
600Snow light snow Snow
601Snow Snow Snow
602Snow Heavy snow Snow
611Snow Sleet Sleet
612Snow Light shower sleet Sleet
613Snow Shower sleet Sleet
615Snow Light rain and snow Snow
616Snow Rain and snow Snow
620Snow Light shower snow Snow
621Snow Shower snow Snow
622Snow Heavy shower snow Snow
701Mist mist Hazy
711Smoke Smoke Hazy
721Haze Haze Hazy
731Dust sand/ dust whirls Hazy
741Fog fog Foggy
751Sand sand Foggy
761Dust dust Foggy
762Ash volcanic ash Foggy
771Squall squalls Rain
781Tornado tornado Strong rain
800Clear clear sky Cloudless
801Clouds few clouds: 11-25% Some clouds
802Clouds scattered clouds: 25-50% Some clouds
803Clouds broken clouds: 51-84% Cloudy
804Clouds overcast clouds: 85-100% Overcast

Transforming weather data, temperature

Input: Temperature, Celsius, a floating point number, absent or with some value.

If absent, the temperature in the App is set to -?- (meaning undefined).

Else the temperature text in the App is setup from this number, according to the list in Showing temp & visibility icons.

Transforming weather data, visibility

Input: Visibility, meter, an integer number, absent or with value 0 and above.

If absent, the visibility in the App is set to -?- (meaning undefined).

Else the visibility text in the App is setup according to the table below:

Visibility, meter Visibility in App
>= 10000Good
>= 5000Mod.
>= 1000Misty
>= 180Lgt fog
>= 0Hvy fog

Sailor Logbook App manual - © Copyright 2018 CoaSoft LLC Denmark

<=  Using Multiple dev.  

  Editing  =>

Sailor Logbook App (7.7)
Using Weatherfetch