This api provides a java client to the OpenCage geocoding service. https://opencagedata.com/api
Repository
<repositories>
<!-- ... other repository elements ... -->
<repository>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>bintray</name>
<url>http://jcenter.bintray.com</url>
</repository>
</repositories>
Dependency
<dependencies>
<!-- ... other dependency elements ... -->
<dependency>
<groupId>com.byteowls</groupId>
<artifactId>jopencage</artifactId>
<version>replace.with.version</version>
</dependency>
</dependencies>
Repository
repositories {
jcenter()
}
// or
repositories {
maven {
url "http://jcenter.bintray.com"
}
}
Dependency
dependencies {
compile ("com.byteowls:jopencage:replace.with.version")
}
Forward
// 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
// 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);
- JDK 8+
- Apache Http Client
- FasterXml Jackson
- slf4j
- Fork repo
- Open command line
- Clone your fork
git@github.com:USERNAME/jopencage.git
cd jopencage
- Build eclipse meta data
./gradlew cleanEclipse eclipse
- Open Eclipse
- File -> Import... -> General -> Existing Projects into Workspace
- Browse to your git repository
- Check the option "Search for nested projects"
- Press finish
This should take not more than 1-2 minutes. You does not need to use any gradle eclipse plugins.
Please do not mix more than one issue in a feature branch. Each feature/bugfix should have its own branch and its own Pull Request (PR).
- Create a issue and describe what you want to do at Issue Tracker
- Create your feature branch (
git checkout -b feature/my-feature
orgit checkout -b bugfix/my-bugfix
) - Test your changes to the best of your ability.
- Add a demo view to the demo application
- Commit your changes (
git commit -m 'Describe feature or bug'
) - Push to the branch (
git push origin feature/my-feature
) - Create a Github Pull Request
This repo includes a .editorconfig file, which your IDE should pickup automatically.
If not: Please use the sun coding convention. Please do not use tabs at all!
Try to change only parts your feature or bugfix requires.
For running the tests you have to use your own OpenCage API Key.
- OPENCAGE_API_KEY ... Provide your own opencage api key using env variables. e.g. -DOPENCAGE_API_KEY=YourKey
Apache 2.0. Please see LICENSE.