The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.
The whatthreewords package supports working with the what3words API from R. what3words has partitioned the surface of the earth into 3m x 3m squares, each of which can be identified by three words. These are conventionally styled with three slashes at the beginning. For example, the peak of the Great Pyramid of Giza is located by the three words ///ballots.height.silks.
You can use the package to determine the three word address for any coordinates, or return the coordinates for any valid three word combination.
You can install the development version of whatthreewords from GitHub with:
# install.packages("devtools")
::install_github("DavidASmith/whatthreewords") devtools
The what3words API requires a key for authentication. You can register for a key at https://developer.what3words.com/public-api.
You must then set the WTW_API_KEY
environment variable
to hold your key. For example…
Sys.setenv(WTW_API_KEY = "MYKEY")
Here are a few examples of what you can do with the package. For more details, see the vignette ‘Using whatthreewords’.
Use words_from_coords
to get a what3words location for a
given latitude and longitude.
library(whatthreewords)
words_from_coords(lat = 51.5095,
lon = -0.1266)
#> [1] "lamp.inner.dent"
This is vectorised over lat
and lon
.
words_from_coords(lat = c(53.3703, 53.41145, 53.3096),
lon = c(-1.47119, -1.500204, -1.478715))
#> [1] "elite.icon.levels" "weep.stands.shack" "soon.belt.owls"
coords_from_words
returns the coordinates for a
what3words location.
coords_from_words("hours.flesh.petal")
#> Warning: ERROR: QuotaExceeded: Quota Exceeded. Please upgrade your usage plan,
#> or contact support@what3words.com
#> lat lon
#> [1,] NA NA
There is an alternative R client for what3words available on CRAN (Github repo). However, this has not been updated (at time of writing) for several years and I couldn’t get it to work. I needed something fairly quickly so wrote this from scratch.
These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.