Java wrapper for the what3words web-API.
Use the what3words API in your Java applications.
String apiKey = "my-super-w3w-apikey";
What3Words w3w = new What3Words(apiKey);
String[] words = {"goldfish", "fuzzy", "aggregates"};
try {
double[] coords = w3w.wordsToPosition(words);
System.out.println(coords[0] + " / " + coords[1]);
} catch (Exception e) {
// do your error handling
}
String apiKey = "my-super-w3w-apikey";
What3Words w3w = new What3Words(apiKey);
Double[] coords = {49.422636, 8.320833};
try {
// optionally set a different language
String[] words = w3w.positionToWords(coords, "de");
System.out.println(words[0] + "." + words[1] + "." + words[2]);
} catch (Exception e) {
// do your error handling
}
JDK and Maven need to be installed on your system.
- Clone this repository
- Run
mvn package -DW3W_API_KEY=YOUR-API-KEY
or - Run
mvn package
in case you do not want to enter your API key for test. Tests requiring API key will be skipped. - Under
target/
you will find the filew3w-java-wrapper-<version>-jar-with-dependencies.jar
which can be embedded into your Java application
Any contribution is warmly welcome:
- Documentation
- Bug reporting
- Bug fixes
- Code enhancements
Thanks to what3words for offering such a great project and for any help we received by their team.
Also a big thank you to all who contributed to this project:
You need more information or support? Please contact us at
info__(at)meggsimum(dot)__de