Pelias Client Library

A Java client library for the Pelias geocoder

Лицензия

Лицензия

Категории

Категории

CLI Взаимодействие с пользователем
Группа

Группа

edu.usf.cutr
Идентификатор

Идентификатор

pelias-client-library
Последняя версия

Последняя версия

1.0.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

Pelias Client Library
A Java client library for the Pelias geocoder
Ссылка на сайт

Ссылка на сайт

https://github.com/CUTR-at-USF/pelias-client-library
Система контроля версий

Система контроля версий

http://github.com/CUTR-at-USF/pelias-client-library

Скачать pelias-client-library

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/edu.usf.cutr/pelias-client-library/ -->
<dependency>
    <groupId>edu.usf.cutr</groupId>
    <artifactId>pelias-client-library</artifactId>
    <version>1.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/edu.usf.cutr/pelias-client-library/
implementation 'edu.usf.cutr:pelias-client-library:1.0.1'
// https://jarcasting.com/artifacts/edu.usf.cutr/pelias-client-library/
implementation ("edu.usf.cutr:pelias-client-library:1.0.1")
'edu.usf.cutr:pelias-client-library:jar:1.0.1'
<dependency org="edu.usf.cutr" name="pelias-client-library" rev="1.0.1">
  <artifact name="pelias-client-library" type="jar" />
</dependency>
@Grapes(
@Grab(group='edu.usf.cutr', module='pelias-client-library', version='1.0.1')
)
libraryDependencies += "edu.usf.cutr" % "pelias-client-library" % "1.0.1"
[edu.usf.cutr/pelias-client-library "1.0.1"]

Зависимости

compile (4)

Идентификатор библиотеки Тип Версия
com.fasterxml.jackson.core : jackson-core jar 2.7.3
com.fasterxml.jackson.core : jackson-databind jar 2.7.3
com.fasterxml.jackson.core : jackson-annotations jar 2.7.3
de.grundid.opendatalab : geojson-jackson jar 1.6

test (1)

Идентификатор библиотеки Тип Версия
junit : junit jar 4.12

Модули Проекта

Данный проект не имеет модулей.

pelias-client-library Build Status Download

A Java library that makes it easy to call the Pelias Search and Autocomplete APIs

Requirements

You'll need JDK 7 or higher.

Including this library in your application

See the pelias-client-library-demo project for an example of how to use this library.

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

<dependencies>
  <!-- Pelias Client Library -->
  <dependency>
      <groupId>edu.usf.cutr</groupId>    
      <artifactId>pelias-client-library</artifactId>    
      <version>1.1.0</version>
  </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-client-library:1.1.0'
}

Usage

The below example shows how to call the Pelias Search API.

String apiKey = "YourKeyHere";
String text = "London";
PeliasResponse response = new SearchRequest.Builder(apiKey, text).build().call();
System.out.println(response.toString());
PeliasResponse response = new AutocompleteRequest.Builder(apiKey, text).build().call();
System.out.println(response.toString());

Compiling the code yourself

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

CUTR Release Process

Snapshots

We've set up a Maven repository to hold the snapshot artifacts from this project in a Github project - cutr-mvn-repo.

At CUTR, we should run the following at the command-line to create a new artifact:

mvn -DaltDeploymentRepository=cutr-snapshots::default::file:"/Git Projects/cutr-mvn-repo/snapshots" clean deploy

Then commit using Git and push new artifacts to Github.

If you want to include snapshot releases in your project, you'll need to add the following to the pom.xml of the project you want to use it in:

<!-- CUTR SNAPSHOTs/RELEASES -->
<repositories>
    <repository>
        <id>cutr-snapshots</id>
        <url>https://raw.githubusercontent.com/CUTR-at-USF/cutr-mvn-repo/master/snapshots</url>
    </repository>        
</repositories>

Releases

We're hosting releases on JCenter via Bintray.

These are the steps for publishing the pelias-client-library on jcenter repository.

1 - Create an account on Bintray.
2 - Setup your pom.xml

We need to specify the URL from which to distribute your project.

    <distributionManagement>
        <repository>
            <id>jCenter</id>
            <url>https://api.bintray.com/maven/cutr-at-usf/cutr-mvn-repo/pelias-client-library/;publish=1</url>
        </repository>
    </distributionManagement>
3 - Setup your setting.xml

We need to provide Bintray username and API Key to the Maven settings.xml file. This may be under your Maven installation directory (e.g., C:\Program Files\Apache Software Foundation\apache-maven-3.2.5\conf).

<server>
  <id>jCenter</id>
  <username>yourjcenteraccount</username>
  <password>***youraccount-secret-api-key***</password>
</server>

You'll need to import the CUTR secret key if it's a new machine (first time only):

gpg --import C:\xxxxx\CUTR\Maven\private.key

To sign the application (required for distribution to Maven Central), you need to add the following block as well (after importing the CUTR key):

<profile>
    <id>ossrh</id>
    <activation>
        <activeByDefault>true</activeByDefault>
    </activation>
    <properties>
        <gpg.executable>gpg</gpg.executable>
        <gpg.passphrase>the_pass_phrase</gpg.passphrase>
    </properties>
</profile>
4 - Run maven deploy

Finally, we can run mvn deploy to complete publishing.

edu.usf.cutr

Center for Urban Transportation Research @ USF

Версии библиотеки

Версия
1.0.1
1.0.0