What3Words

What3Words is an amazing and potentially game-changing method of describing any location on earth in three words and it is already in use in some countries!!

In this system the world is broken up into 3 metre squares and each of these has a unique name formed of three words.

The example flows here will allow you to enter latitude,longitude and get out a word triplet - and vice-versa.

There is a fantastic introduction (I don't know the guy - I just found the link and went down the rabbit-hole) here...

https://www.ted.com/talks/chris_sheldrick_a_precise_three_word_address_for_every_place_on_earth#t-129860

There are APPS for Android and Apple and a map website where you can discover the three words for any location. https://map.what3words.com

You can find ant location by adding the words to the URL - for example

https://map.what3words.com/brass.visa.sting

Here is the developer page to get your free API key (in my examples (I've put XXXX in the injectors - you need your free API key).

https://what3words.com/developers/

[{"id":"afe60800.0c0e78","type":"http request","z":"3e5d053a.bd597a","name":"","method":"GET","ret":"txt","url":"https://api.what3words.com/v2/forward?key={{{topic}}}&addr={{{payload}}}","tls":"","x":290,"y":140,"wires":[["47858280.c3384c"]]},{"id":"727775e8.a0e16c","type":"inject","z":"3e5d053a.bd597a","name":"Name in","topic":"your-api-key","payload":"helpfully.multiples.liners","payloadType":"str","repeat":"","crontab":"","once":false,"x":120,"y":140,"wires":[["afe60800.0c0e78"]]},{"id":"bd90ea7c.ff7978","type":"debug","z":"3e5d053a.bd597a","name":"","active":true,"console":"false","complete":"false","x":670,"y":140,"wires":[]},{"id":"47858280.c3384c","type":"function","z":"3e5d053a.bd597a","name":"3 words in coords out","func":"result=JSON.parse(msg.payload);\nmsg.payload=result.geometry.lat+\",\"+result.geometry.lng;\nreturn msg;","outputs":1,"noerr":0,"x":480,"y":140,"wires":[["bd90ea7c.ff7978"]]},{"id":"4e9207a.e0aebf8","type":"http request","z":"3e5d053a.bd597a","name":"","method":"GET","ret":"txt","url":"https://api.what3words.com/v2/reverse?key={{{topic}}}&coords={{{payload}}}","tls":"","x":290,"y":100,"wires":[["7ae5c2bf.87772c"]]},{"id":"f631ac0.46ce158","type":"inject","z":"3e5d053a.bd597a","name":"Coords in","topic":"your-api-key","payload":"55.144526,-2.250826","payloadType":"str","repeat":"","crontab":"","once":false,"x":120,"y":100,"wires":[["4e9207a.e0aebf8"]]},{"id":"2600f40e.8c706c","type":"debug","z":"3e5d053a.bd597a","name":"","active":true,"console":"false","complete":"false","x":670,"y":100,"wires":[]},{"id":"7ae5c2bf.87772c","type":"function","z":"3e5d053a.bd597a","name":"coords in 3 words out","func":"result=JSON.parse(msg.payload);\nmsg.payload=result.words;\nreturn msg;","outputs":1,"noerr":0,"x":480,"y":100,"wires":[["2600f40e.8c706c"]]},{"id":"ec089c1f.58b9a","type":"comment","z":"3e5d053a.bd597a","name":"What3Words","info":"What3Words is a revolutionary new system for\naccessing any place on earth to around 3metres by\n3 metres.\n\nTo use this code you will need your own free API key\nwhich you can get from:\nhttps://what3words.com/developers/\n\nIn the first example, your payload should be comma-\nseparated latitude and longitude and the topic \nshould be your API key. The output will be a word\ntriplet i.e. clasping.note.similar\n\nIn the second example your payload should be a dot-\nseparate word triplet - ie clasping.note.similar\nand with the same API key, the output will be a \ncomma-separated lat/long pair\n\nThis should work anywhere in the world and is all\nyou need to identify any location, anywhere.\n\nhttps://map.what3words.com\n\nThere are what3words apps for Apple and Android\nIt is all on the site.\n\nThere is a brilliant introduction on TED\nhttps://www.ted.com/talks/chris_sheldrick_a_precise_three_word_address_for_every_place_on_earth\n","x":120,"y":40,"wires":[]}]

Flow Info

Created 7 years ago
Rating: not yet rated

Owner

Actions

Rate:

Node Types

Core
  • comment (x1)
  • debug (x2)
  • function (x2)
  • http request (x2)
  • inject (x2)

Tags

  • what3words
  • geo-location
  • scargill
Copy this flow JSON to your clipboard and then import into Node-RED using the Import From > Clipboard (Ctrl-I) menu option