Skip to content
This repository has been archived by the owner on May 27, 2024. It is now read-only.

A demo project showing the use of the pelias-client-library, a Java client library for the Pelias geocoder

License

Notifications You must be signed in to change notification settings

CUTR-at-USF/pelias-client-library-demo

Repository files navigation

pelias-client-library-demo Build Status

A demo project showing how to use the pelias-client-library to call the Mapzen Pelias Search API

Code in this project

The below example shows how to call the Pelias Search API - this same code is in the PeliasClientDemo class in this project:

String apiKey = "search-YOUR_KEY_HERE";
String text = "London";
SearchResponse response = new SearchRequest.Builder(apiKey, text).build().call();
System.out.println(response.toString());

Requirements

You'll need JDK 7 or higher.

Setting up your environment

This project was created in IntelliJ. You can also compile it from the command line using Maven.

Getting the code

To get started with this project, use a Git client to clone this repository to your local computer. Then, in IntelliJ import the project as a Maven project.

Dependencies

Managed via Maven:

Build the project

  • IntelliJ - Clean and build the project
  • Maven - mvn install

Using the pelias-client-library library in your application

To add the pelias-client-library to your project using Maven, add the following to your pom.xml file:

<dependencies>
  <!-- Pelias Client Library -->
  <dependency>
      <groupId>edu.usf.cutr.pelias</groupId>    
      <artifactId>pelias-client-library</artifactId>    
      <version>1.0.0</version>
      <type>pom</type>
  </dependency>
</dependencies>

If you're using Gradle and Android Studio, here's what your build.gradle should look like:

...
repositories {
    jcenter()
}

android {
    ...

    // http://stackoverflow.com/questions/20673625/gradle-0-7-0-duplicate-files-during-packaging-of-apk
    packagingOptions {
        exclude 'META-INF/LICENSE'
        exclude 'META-INF/NOTICE'
        exclude 'META-INF/services/com.fasterxml.jackson.core.JsonFactory'
        exclude 'META-INF/services/com.fasterxml.jackson.core.ObjectCodec'
    }
...

dependencies {
    ...
    // Pelias Client library
    compile 'edu.usf.cutr.pelias:pelias-client-library:1.0.0'
}

About

A demo project showing the use of the pelias-client-library, a Java client library for the Pelias geocoder

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages