It seems apple has chosen to show wind direction in the weather conditions on a 0-360 scale instead of N-E-S-W (and all combinations usually made from those)
Does anyone have an idea on how to reference 0-360 to North-East-South-West etc. in a shortcut?
Added difficulty: North would be 350 - 010 f.e. see table below
Modulo arithmetic on the degrees (offset by adding or subtracting the deviation from origin on North = 10 degrees) and then looking up the result by position in an ordered list.
Find a web API or page search to scrape that can work it out.
I came up with the following approximation of the wind direction (also for a shortcuts program):
If degrees is less than 11 or greater than 349 the wind direction is North.
If not, I add 11,25 to the degrees, divide it by 22,5. The result is than rounded down. This way you get a number.
I have a list (woordenboek) from 1 to 15 with all the wind directions from NNE as one, NE as two, ENE as three, etc, eight as South and NNW as 15.
Eg. 187 degrees + 11,25 is 198,25
198,25 / 22,5 = 8,8 rounded down is 8 and therefore the wind direction is South