Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/moberwasserlechner/jopencage
OpenCage geocoding client for Java
https://github.com/moberwasserlechner/jopencage
geocoding java opencage openstreetmap
Last synced: 29 days ago
JSON representation
OpenCage geocoding client for Java
- Host: GitHub
- URL: https://github.com/moberwasserlechner/jopencage
- Owner: moberwasserlechner
- License: apache-2.0
- Created: 2015-06-27T20:39:54.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2023-07-05T18:34:58.000Z (over 1 year ago)
- Last Synced: 2023-07-27T16:28:57.413Z (over 1 year ago)
- Topics: geocoding, java, opencage, openstreetmap
- Language: Java
- Homepage:
- Size: 320 KB
- Stars: 13
- Watchers: 6
- Forks: 19
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: .github/CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# JOpenCage
[![Maven Central](https://img.shields.io/maven-central/v/com.byteowls/jopencage.svg?label=Maven%20Central)](https://search.maven.org/search?q=g:%22com.byteowls%22%20AND%20a:%22jopencage%22)
![Tests](https://github.com/moberwasserlechner/jopencage/workflows/UnitTests/badge.svg)This api provides a java client to the OpenCage geocoding service. https://opencagedata.com/api
## End of life
This repository reached its end of life, please refer to https://github.com/OpenCageData/jopencage for up-to-date releases.
## Usage
Maven
```xml
com.byteowls
jopencage
replace.with.version
```Gradle
```gradle
implementation "com.byteowls:jopencage:REPLACE.WITH.VERSION"
```### Example
Forward
```java
// In real live application the JOpenCageGeocoder should be a Singleton
JOpenCageGeocoder jOpenCageGeocoder = new JOpenCageGeocoder(YOUR_API_KEY);JOpenCageForwardRequest request = new JOpenCageForwardRequest("Graz");
request.setMinConfidence(1);
request.setNoAnnotations(false);
request.setNoDedupe(true);
JOpenCageResponse response = jOpenCageGeocoder.forward(request);
```Reverse
```java
// In real live application the JOpenCageGeocoder should be a Singleton
JOpenCageGeocoder jOpenCageGeocoder = new JOpenCageGeocoder(YOUR_API_KEY);JOpenCageReverseRequest request = new JOpenCageReverseRequest(-22.6792, 14.5272);
request.setNoAnnotations(true);JOpenCageResponse response = jOpenCageGeocoder.reverse(request);
```## Libraries
* JDK 8+
* Apache Http Client
* FasterXml Jackson
* Slf4j## Testing
For running the tests you have to use your *OWN* OpenCage API Key. Get a free trial key at https://opencagedata.com/dashboard#api-keys
```
./gradlew -DOPENCAGE_API_KEY= test
```## Gradle
```
./gradlew wrapper --gradle-version 6.8.3
```## Contribute
See [Contribution Guidelines](https://github.com/moberwasserlechner/jopencage/blob/master/.github/CONTRIBUTING.md).
## Changelog
See [CHANGELOG](https://github.com/moberwasserlechner/jopencage/blob/master/CHANGELOG.md).## License
Apache 2.0. Please see [LICENSE](https://github.com/moberwasserlechner/jopencage/blob/master/LICENSE).
## Disclaimer
We have no business relation to OpenCage.