# Convert Wind direction in degrees to Cardinal points

**URL:** <https://discourse.nodered.org/t/convert-wind-direction-in-degrees-to-cardinal-points/10931>\
**Category:** Share Your Projects\
**Created:** [8 May 2019 21:50 UTC](https://discourse.nodered.org/t/convert-wind-direction-in-degrees-to-cardinal-points/10931 "2019-05-08T21:50:51Z")\
**Posts on this page:** 20\
**Page:** 2

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [24 April 2020 22:27 UTC](https://discourse.nodered.org/t/convert-wind-direction-in-degrees-to-cardinal-points/10931/21 "2020-04-24T22:27:24Z")

</div>

> [@dceejay](#):
>
> And if that's a ui node we usually expect ui in the name

Is it a ui node?? I assumed that it wasn't looking at the repo.

> [@dceejay](#):
>
> While NbE is technically correct those finer points are usually never used

The readme suggests that subsets are optional.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [24 April 2020 23:14 UTC](https://discourse.nodered.org/t/convert-wind-direction-in-degrees-to-cardinal-points/10931/22 "2020-04-24T23:14:45Z")

</div>

Apologies all round. I naturally assumed as Bart is Mr SVG that he was going the whole hog ! Yes. Looks fine as is

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [25 April 2020 07:08 UTC](https://discourse.nodered.org/t/convert-wind-direction-in-degrees-to-cardinal-points/10931/23 "2020-04-25T07:08:50Z")

</div>

> [@dceejay](#):
>
> And if that's a ui node

Oh my god, I got a heart attack this morning. Was thinking: had Garry requested a ui node, and is my english that bad 😂

> [@dceejay](#):
>
> translations... well in French West is Ouest so I would expect the abbreviation to be O - but maybe they accept W ???

For the 4 main directions it is no problem, but for all other intermediate ones... I have ever never used those in Dutch ...

> [@dceejay](#):
>
> While NbE is technically correct those finer points are usually never used

Should I perhaps change the default value of the dropdown, i.e. not all by default?

I have added another option, to select the _ **conversion direction** _: from degree to cardinal (which is the default) or the other way around. The label is automatically updated, unless you specify a name in the node.

![demo_cardinal](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/3X/1/1/11954e1f3eb20276aae8098e8bf9b5b8e8a046e6.gif)

P.S. I have not added migration logic, so if you have already an existing node in your flow then this new "Direction" field will be _empty_. No use to add that for one or two test users...

Today working in the garden. See you later!

---

<div class="post-metadata">

**Author:** ![greengolfer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/greengolfer/32/28276_2.png) [@greengolfer](https://discourse.nodered.org/u/greengolfer)\
**Post date:** [25 April 2020 17:24 UTC](https://discourse.nodered.org/t/convert-wind-direction-in-degrees-to-cardinal-points/10931/24 "2020-04-25T17:24:17Z")

</div>

> [@dceejay](#):
>
> translations... well in French West is Ouest so I would expect the abbreviation to be O - but maybe they accept W ??? need a French expert here...

Here is one 🙂  
No, in French West is Ouest and the abbreviation being O (W will not be understood by non english speakers). Luckily the other cardinals start with the same letter.

GV

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [25 April 2020 17:34 UTC](https://discourse.nodered.org/t/convert-wind-direction-in-degrees-to-cardinal-points/10931/25 "2020-04-25T17:34:57Z")

</div>

Hi @greengolfer,  
Thanks. If you would have interest to translate the [table](https://github.com/bartbutenaers/node-red-contrib-cardinal-direction/blob/master/README.md#available-cardinal-directions) on my readme page (both colums), the I could create a french translation file...

---

<div class="post-metadata">

**Author:** ![greengolfer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/greengolfer/32/28276_2.png) [@greengolfer](https://discourse.nodered.org/u/greengolfer)\
**Post date:** [25 April 2020 17:54 UTC](https://discourse.nodered.org/t/convert-wind-direction-in-degrees-to-cardinal-points/10931/26 "2020-04-25T17:54:20Z")

</div>

```auto
| Nom | Légende |
| ------ | ---------------------- |
| N | nord |
| N1/4E | nord-quart-est |
| NNE | nord-nord-est |
| NE1/4N | nord-est-quart-nord |
| NE | nord-est |
| NE1/4E | nord-est-quart-est |
| ENE | est-nord-est |
| E1/4N | est-quart-nord |
| E | est |
| E1/4S | est-quart-sud |
| ESE | est-sud-est |
| SE1/4E | sud-est-quart-est |
| SE | sud-est |
| SE1/4S | sud-est-quart-sud |
| SSE | sud-sud-est |
| S1/4E | sud-quart-est |
| S | sud |
| S1/4O | sud-quart-ouest |
| SSO | sud-sud-ouest |
| SO1/4S | sud-ouest-quart-sud |
| SO | sud-ouest |
| SO1/4O | sud-ouest-quart-ouest |
| OSO | ouest-sud-ouest |
| O1/4S | ouest-quart-sud |
| O | ouest |
| O1/4s | ouest-quart-nord |
| ONO | ouest-nord-ouest |
| NO1/4O | nord-ouest-quart-ouest |
| NO | nord-ouest |
| NO1/4N | nord-ouest-quart-nord |
| NNO | nord-nord-ouest |
| N1/4O | nord-quart-ouest |

```

Here you go. Not sure how you want it in github.  
BTW, I also work in weather, and I have never heard of NbE. I found on wikipedia that in French it is "quart" (1/4) but it is never used AFAIK...

GV

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [25 April 2020 19:44 UTC](https://discourse.nodered.org/t/convert-wind-direction-in-degrees-to-cardinal-points/10931/27 "2020-04-25T19:44:01Z")

</div>

Thank you very much!!! I will add it to github...

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [25 April 2020 21:13 UTC](https://discourse.nodered.org/t/convert-wind-direction-in-degrees-to-cardinal-points/10931/28 "2020-04-25T21:13:08Z")

</div>

> [@greengolfer](#):
>
> BTW, I also work in weather, and I have never heard of NbE. I found on wikipedia that in French it is "quart" (1/4) but it is never used AFAIK...

I have never used this weather stuff before. Just developed this node to assist some users in this discussion ...  
When I look on [wikipedia](https://en.wikipedia.org/wiki/Points_of_the_compass) the NBE means _"north by east"_. In french that would correspond to _"nord-quart-est"_, so I would expect NQE (instead of N1/4E)? And if the N1/4E in french is correct, theN I would expect the english version to be N1/4E also?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [25 April 2020 21:53 UTC](https://discourse.nodered.org/t/convert-wind-direction-in-degrees-to-cardinal-points/10931/29 "2020-04-25T21:53:08Z")

</div>

well the docs seems to say the English is NbE - but as I said I don't think anyone ever uses that... 16 points is enough.

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [25 April 2020 23:19 UTC](https://discourse.nodered.org/t/convert-wind-direction-in-degrees-to-cardinal-points/10931/30 "2020-04-25T23:19:14Z")

</div>

I hate to be overly pedantic (my wife is laughing hysterically as I type this), but there are some issues of terminology here. (I can only speak to US/UK usage.) The only directions that are "cardinal" are N, S, E, and W, so the name of the node is not quite right, but I can't think of anything better. The conversions probably should be described as "degree to compass point" and "compass point to degree". Perhaps shorten "compass point" to "point" in the label.

The terms used for sets of compass points are a bit scrambled.  
As noted, the cardinal directions are N, S, E, and W.  
NE, SE, SW and NW are the inter-cardinals or ordinals.  
The four cardinal directions plus the four inter-cardinals comprise the eight principal directions.  
NNE, ENE, ESE, SSE, SSW, WSW, WNW, and NNW are inter-ordinal or secondary directions.  
The eight principal directions plus the eight secondary directions comprise the usual 16-point compass rose.  
So, the filters should be named accordingly, and it might help to note the number of compass points in each set:  
"Full" is OK but could be Complete (32)  
"Basic" should be Cardinal (4)  
"Ordinal" should be Principal (8)  
"Intercardinal" should be Principal + Secondary (16)

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [25 April 2020 23:25 UTC](https://discourse.nodered.org/t/convert-wind-direction-in-degrees-to-cardinal-points/10931/31 "2020-04-25T23:25:42Z")

</div>

> [@dceejay](#):
>
> 16 points is enough.

Not if you're asked to "box the compass." 😓

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [26 April 2020 05:57 UTC](https://discourse.nodered.org/t/convert-wind-direction-in-degrees-to-cardinal-points/10931/32 "2020-04-26T05:57:25Z")

</div>

Hi Mike,  
nice to see you are joining their discussion.

> [@drmibell](#):
>
> but there are some issues of terminology here. (I can only speak to US/UK usage.)

I have reused all the terminology from the [cardinal-direction](https://www.npmjs.com/package/cardinal-direction) library, that I'm using under the cover. But your proposals make sense to me! But I wrote this node for all the blokes above, so they have to decide. Moreover I'm not native english speaking, so I'm not in a position to doubt about this. I write everything in English, to make sure that the english speaking people can sit back and relax 😉

> [@drmibell](#):
>
> Not if you're asked to "box the compass." 😓

BTW These kind of sentences are always difficult to understand, and Google Translate always fails to give a decent translation. So not sure what you mean ...

I have rewritten my code yesterday evening (local version not on Github) to have only 16 points, so it is now much easier for people to send me translations for their own language. Is this a hypothetical case you are talking about? If the 16 points are enough (in real life cases), then I would like to keep it like that...

---

<div class="post-metadata">

**Author:** ![greengolfer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/greengolfer/32/28276_2.png) [@greengolfer](https://discourse.nodered.org/u/greengolfer)\
**Post date:** [26 April 2020 06:07 UTC](https://discourse.nodered.org/t/convert-wind-direction-in-degrees-to-cardinal-points/10931/33 "2020-04-26T06:07:06Z")

</div>

> [@BartButenaers](#):
>
> I have rewritten my code yesterday evening (local version not on Github) to have only 16 points, so it is now much easier for people to send me translations for their own language. Is this a hypothetical case you are talking about? If the 16 points are enough (in real life cases), then I would like to keep it like that...

Agreed !! It is rather unlikely that we will be using nodered to pilot a submarine where the 32 directions might be useful. For "normal life" situation, 16 is, I think sufficient. It will also make the life of the translators much easier 🙂

GV

---

<div class="post-metadata">

**Author:** ![greengolfer](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/greengolfer/32/28276_2.png) [@greengolfer](https://discourse.nodered.org/u/greengolfer)\
**Post date:** [26 April 2020 06:11 UTC](https://discourse.nodered.org/t/convert-wind-direction-in-degrees-to-cardinal-points/10931/34 "2020-04-26T06:11:19Z")

</div>

> [@BartButenaers](#):
>
> When I look on [wikipedia](https://en.wikipedia.org/wiki/Points_of_the_compass) the NBE means _"north by east"_ . In french that would correspond to _"nord-quart-est"_ , so I would expect NQE (instead of N1/4E)? And if the N1/4E in french is correct, theN I would expect the english version to be N1/4E also?

According to wikipedia ([N. ¼ N. E. — Wiktionnaire, le dictionnaire libre](https://fr.wiktionary.org/wiki/N._%C2%BC_N._E.)) it is really 1/4 (and not q) in French at least... But, as I said I don't really know. However, considering the follow up on the thread, I assume it is not really an issue any more.

GV

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [26 April 2020 06:31 UTC](https://discourse.nodered.org/t/convert-wind-direction-in-degrees-to-cardinal-points/10931/35 "2020-04-26T06:31:57Z")

</div>

> [@greengolfer](#):
>
> I assume it is not really an issue any more

Let's hope so 😉  
Thanks for sharing your insights! It becomes easier to develop something, when you get feedback from people using it in real life ...

---

<div class="post-metadata">

**Author:** ![Paul-Reed](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/paul-reed/32/66906_2.png) [@Paul-Reed](https://discourse.nodered.org/u/Paul-Reed)\
**Post date:** [26 April 2020 09:11 UTC](https://discourse.nodered.org/t/convert-wind-direction-in-degrees-to-cardinal-points/10931/36 "2020-04-26T09:11:17Z")

</div>

Only 16 points??...and I was so looking forward to using [half & quarter points](https://www.wikiwand.com/en/Points_of_the_compass#/Half-_and_quarter-points) 🤣 🤣

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [26 April 2020 09:28 UTC](https://discourse.nodered.org/t/convert-wind-direction-in-degrees-to-cardinal-points/10931/37 "2020-04-26T09:28:25Z")

</div>

Cue jokes about the ancient mariner....

---

<div class="post-metadata">

**Author:** ![drmibell](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/drmibell/32/8424_2.png) [@drmibell](https://discourse.nodered.org/u/drmibell)\
**Post date:** [26 April 2020 16:34 UTC](https://discourse.nodered.org/t/convert-wind-direction-in-degrees-to-cardinal-points/10931/38 "2020-04-26T16:34:57Z")

</div>

> [@BartButenaers](#):
>
> Hi Mike,  
> nice to see you are joining their discussion.

Thanks, Bart. The time difference (and other events) can make it difficult to stay engaged.

> [@BartButenaers](#):
>
> terminology from the [cardinal-direction](https://www.npmjs.com/package/cardinal-direction) library

I failed to look at the source code, so missed the fact that you were using this library. I'm sure the calculation is fine, but the terminology is wrong. The reference from @Paul-Reed is better, as is the Wikipedia article on [points of the compass](https://en.wikipedia.org/wiki/Points_of_the_compass).

> [@BartButenaers](#):
>
> These kind of sentences are always difficult to understand

Sorry, it was just an aside to @dceejay, possibly an ancient mariner joke. Somehow, I assumed he is a recreational sailor or at least lives close enough to the coast to have heard the phrase. "Boxing the compass" is a part of traditional maritime training, where the sailor is asked to recite the points of the compass, generally 32 but sometimes 128, usually in clockwise order but sometimes in both directions. It's the only use I've made of half and quarter points in over 60 years of hanging around the water.

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [26 April 2020 17:28 UTC](https://discourse.nodered.org/t/convert-wind-direction-in-degrees-to-cardinal-points/10931/39 "2020-04-26T17:28:06Z")

</div>

Indeed. They no longer teach it at the UK naval academy, so I think it’s old enough for academic interest only.

Also if someone ever did do an SVG version for the UI I wouldn’t want it too crowded with points so that ir was still readable, and consistent with this node.

---

<div class="post-metadata">

**Author:** ![ghayne](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ghayne/32/39_2.png) [@ghayne](https://discourse.nodered.org/u/ghayne)\
**Post date:** [26 April 2020 17:34 UTC](https://discourse.nodered.org/t/convert-wind-direction-in-degrees-to-cardinal-points/10931/40 "2020-04-26T17:34:41Z")

</div>

> [@drmibell](#):
>
> It's the only use I've made of half and quarter points in over 60 years of hanging around the water.

I passed my German Coastal waters boating licence many years ago, 16 points of the compass would not have been enough to pass the navigation part of the exam 🙂

[Previous page](https://discourse.nodered.org/t/convert-wind-direction-in-degrees-to-cardinal-points/10931.md?page=1)

[Next page](https://discourse.nodered.org/t/convert-wind-direction-in-degrees-to-cardinal-points/10931.md?page=3)
