OLS Client Geocode Search API

It provides method to search geocodes

For the full GeocodeApi specification, see GeocodeApi.

The following pages describe the per-request configuration and metrics.

Example

Scala
Java
val client = BaseClient()
val geocodeApi = client.of[GeocodeApi]

val result = geocodeApi.geocodeGet("125, Berliner, berlin").executeToEntity()

result
  .andThen {
    case Success(response: OpenSearchGeocodeResponse) =>
      // do something with the geocodes
      response.items.foreach(geocodes => geocodes.foreach(geocode => println(geocode.getTitle)))
    case Failure(ex) =>
      ex.printStackTrace()
  }

Await.result(result, Duration.Inf)
BaseClient client = BaseClientJava.instance();
GeocodeApi geocodeApi = new GeocodeApi(client);
OpenSearchGeocodeResponse openSearchGeocodeResponse =
    geocodeApi
        .geocodeGet()
        .withQ("125, Berliner, berlin")
        .build()
        .executeToEntity()
        .toCompletableFuture()
        .join();

// do something with the geocodes
openSearchGeocodeResponse
    .getItems()
    .ifPresent(list -> list.forEach(item -> item.getTitle().ifPresent(System.out::println)));

Examples of responses can be found in the Developer Guide

results matching ""

    No results matching ""