OLS クライアント HERE Destination Weather v3 API

HERE Destination Weather v3 では、リアルタイムの天気予報と天気予報を参照できます。

WeatherAPI のすべての 仕様については、 WeatherApi を参照してください。

次のページで は、リクエストごとの設定メトリックについて説明します。

Scala
Java
val client = BaseClient()
val weatherApi = client.of[WeatherReportApi]

val result = weatherApi
  .weatherReport(
    products = Seq(WeatherProduct.Product.Observation),
    q = Option.apply("Brandenburg Gate, Berlin"),
    oneObservation = Option.apply(true)
  )
  .executeToEntity()

result
  .andThen {
    case Success(response) =>
      // do something with the weather response
      println(response.places)
    case Failure(ex) =>
      ex.printStackTrace()
  }

Await.result(result, Duration.Inf)
BaseClient client = BaseClientJava.instance();
WeatherReportApi weatherApi = new WeatherReportApi(client);

WeatherReport response =
    weatherApi
        .weatherReport()
        .withProducts(
            Collections.singletonList(
                WeatherProduct.ProductParser$.MODULE$.parse("observation")))
        .withQ(Optional.of("Brandenburg Gate, Berlin"))
        .withOneObservation(Optional.of(true))
        .build()
        .toEntity();

// do something with the weather response
response.getPlaces().ifPresent(System.out::println);

応答の例については、 API リファレンスを参照してください

」に一致する結果は 件です

    」に一致する結果はありません