Composite tag to geocode with what3words.com (config file)

Started by CWCorrea, February 28, 2024, 01:18:45 PM

Previous topic - Next topic

CWCorrea

The attached config file (w3w.config) defines the Composite tag What3Words that convert GPS coordinates to three words using the https://what3words.com API.

It requires "curl" (https://curl.se) and "jq" (https://jqlang.github.io/jq/) to be installed in your PATH. It also requires a what3words API key. You can request a free API key (that includes 100 requests per month) at https://accounts.what3words.com/select-plan.

The required what3words API key is passed to ExifTool with the -UserParam Key=XXXXXXXX (replace XXXXXXXX with your own key). The optional -UserParam Language=YY sets the language of the three words returned by the What3Words tag (replace YY with the desired two-letter language code. example: es for spanish, it for italian). The default language is english (en).

exiftool -config w3w.config -gpslatitude -gpslongitude -what3words -userparam key=XXXXXXXX -userparam language=en image.jpg

GPS Latitude                    : +38.861903
GPS Longitude                   : -77.116753
What 3 Words                    : fight.ranged.rapid

This config file has been tested with ExifTool 12.77 on macOS and Linux. I don't use Windows, so it would be great if a Windows user tried it and reported back. Thanks.

Christian W.

Phil Harvey

Hi Christian,

Very interesting.  Thanks for sharing this.

- Phil

BTW, you had attached your config file twice so I deleted the duplicate.
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux/PowerShell, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

CWCorrea

#2
Solving this was an enjoying experience. Learning new things about ExifTool, asking questions and reading a lot of forum posts. That post on the REQ_TAG_LOOKUP private member and your answer on how to print warning messages was key to building that config file.

I'm playing with some APIs to do geocoding. I will share other config files when I finish them.

Christian W.

PH Edit: Added link to REQ_TAG_LOOKUP post.

StarGeek

Some time ago I made a W3W config file as a place to save the What3Words in an XMP-w3w name space. If I recall, the data returned from W3W included the corner coordinates (upper left, lower right) for that location.  I had planned on expanding this config to include a spot for the rest of the data but never got around to it.
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype