Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Does QGIS have any plugin to work with the WhatThreeWords mapping project? If not now, are there any plugins in process?

share|improve this question
    
What does "work with" mean? What do you want to do? Its taken me twenty minutes to write a QGIS custom python function that lets me label points with what3words locations, but thats 20 minutes wasted if that's not what you want. – Spacedman Feb 3 at 17:51
1  
Don't forget to mark Spacedman's answer as having solved the question! – Stephen Lead Feb 4 at 3:17
    
I would like to contribute if some creates a module. – Verena Haunschmid Feb 4 at 5:57

Using a simple w3w wrapper here:

https://github.com/what3words/w3w-python-wrapper

I wrote a custom python function to return the what3words given a location. Once hooked into the expression engine, you can do something like generate labels with what3words:

enter image description here

This is done with the following expression in the layer label dialog:

concat("name", 
  ' : ',
  w3w(   transform( $geometry, layer_property(@layer_id, 'crs'), 'EPSG:4326')))

and my w3w function looks like this (along with the file from the github repo above)

@qgsfunction(args=1, group='Custom')
def w3w(value1, feature, parent):
    (long, lat) = value1[0].asPoint()

    w3w = what3words(apikey='YOURAPIKEYHERE')
    res = w3w.getWords(lat=lat, lng=long)
    return "%s" % ".".join(res['words'])

In all this took me about twenty minutes.

But the real question is what do you want to do with what3words?

share|improve this answer
4  
Good Answer! code, explanation & solution in a tidy summary, well done – Mapperz Feb 3 at 19:14
    
Wow, that is amazing, thanks for doing this. I will look at your code and learn. That's what I really wanted to do - learn how to use what3words in a mapping environment like qgis. – Jim Feb 3 at 22:51
    
Great use of the custom expressions! – Nathan W Feb 4 at 1:11
    
I have an API key for w3w. but when i call my api w3w=what3words(apikey='apikey') it gives me an error NameError: name 'what3words' is not defined – ziggy May 3 at 15:48
    
is there a module i have to download and import into python before using this geocoding service? – ziggy May 3 at 15:49

Boundless have recently written a plugin that integrates What3Words in to QGIS. The plugin allows you to zoom to a What3Words address and also to click on the map and display the What3Words address of the point you clicked. Note it doesn't display the What3Words 3mx3m grid. Full details can be found here:

http://boundlessgeo.com/2016/03/what3words-in-qgis-down-load-today/

At the moment the plugin needs to be installed manually. This is really easy, you just download the files from GitHub then copy the 'what3words' folder to your plugins directory on your local PC (something like C:\Users\.qgis2\pyton\plugins\ on Windows), then enable the plugin through the plugin manager in QGIS.

The only other thing you need is a What3Words API key, which you can get by registering with them on this page: http://developer.what3words.com/

share|improve this answer
    
+1, thanks for sharing the latest release of the plugin! – Joseph Mar 15 at 15:57

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.