GeocodeApi
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
val client = BaseClient()
val geocodeApi = client.of[GeocodeApi]
val result = geocodeApi.geocodeGet(q = Some("125, Berliner, berlin")).executeToEntity()
result
.andThen {
case Success(response: OpenSearchGeocodeResponse) =>
// do something with the geocodes
response.items.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(Optional.of("125, Berliner, berlin"))
.build()
.executeToEntity()
.toCompletableFuture()
.join();
// do something with the geocodes
openSearchGeocodeResponse.getItems().forEach(item -> System.out.println(item.getTitle()));Examples of responses can be found in the Developer Guide
Updated 21 days ago