不完全な位置情報のクエリを使用して、placesの候補を取得します

このチュートリアルでは、不完全な場所のクエリを使用して場所を検索する方法について説明します。

プロシージャ

/autosuggest を使用しているアプリケーションのユーザーが、ベルリンのある場所にいます。「Berlin Brandenburg というクエリを使用して、「Berlin Brandenburg Willy Brandt」という名前の新しい空港を検索する予定です。 アプリケーションは、 3 番目のキーストークから開始して、Autosuggestクエリーの送信を開始します。 8 番目のAutosuggest クエリーは次のように表示されます。

GET https://autosuggest.search.hereapi.com/v1/
    autosuggest
    ?at=52.5199813,13.3985138
    &lang=en
    &q=berlin+bran
    &apiKey={YOUR_API_KEY}

次のパラメータが使用されます。

  • at - 座標で表された検索コンテキストの中心を指定
  • lang- BCP 47 に準拠した言語コードのリストから、結果のレンダリングに使用する言語を選択
  • Q - フリーテキストのクエリを入力します。
  • apiKey - お客様の API キー 。

この要求は API キー 認証を使用します。 HERE platform の認証オプションの詳細については、『ID およびアクセス管理ガイド』を参照してください。

結果には、関連するロケーションオブジェクトに関する詳細情報が一覧表示されます。

{
  "items": [
    {
      "title": "Brandenburg Gate",
      "id": "here:pds:place:276u33db-8ee2e0de906e459cbade0593986debe9",
      "resultType": "place",
      "address": { "label": "Brandenburg Gate, Pariser Platz 1, 10117 Berlin, Germany" },
      "position": { "lat": 52.51628, "lng": 13.37771 },
      "access": [{ "lat": 52.5163, "lng": 13.37799 }],
      "distance": 1466,
      "categories": [{ "id": "300-3000-0025", "name": "Historical Monument", "primary": true }, { "id": "700-7460-0115", "name": "Tourist Information" }],
      "references": [{ "supplier": { "id": "core" }, "id": "800842663" }, { "supplier": { "id": "core" }, "id": "935939740" }],
      "highlights": { "title": [ ], "address": { "label": [ ] } }
    },
    {
      "title": "Berlin Brandenburg Airport Willy Brandt",
      "id": "here:pds:place:276u339g-0dd32a93728c47c3b35985e550f30a70",
      "resultType": "place",
      "address": { "label": "Berlin Brandenburg Airport Willy Brandt, Melli-Beese-Ring 1, 12529 Schönefeld, Germany" },
      "position": { "lat": 52.36395, "lng": 13.50864 },
      "access": [{ "lat": 52.36447, "lng": 13.51003 }],
      "distance": 18887,
      "categories": [{ "id": "400-4000-4581", "name": "Airport", "primary": true }],
      "references": [{ "supplier": { "id": "core" }, "id": "1098368287" }, { "supplier": { "id": "yelp" }, "id": "L4LMcEkbutFG3bz-1i-keg" }],
      "highlights": { "title": [ ], "address": { "label": [ ] } }
    },
    {
      "title": "Gesundbrunnen Center",
      "id": "here:pds:place:276u33db-84435950c4084967be9ccca7c6603d4e",
      "resultType": "place",
      "address": { "label": "Gesundbrunnen Center, Badstraße 4, 13357 Berlin, Germany" },
      "position": { "lat": 52.54971, "lng": 13.38749 },
      "access": [{ "lat": 52.54965, "lng": 13.3874 }],
      "distance": 3389,
      "categories": [
        { "id": "600-6100-0062", "name": "Shopping Mall", "primary": true },
        ...
      ],
      "chains": [{ "id": "6825" }],
      "references": [
        { "supplier": { "id": "core" }, "id": "50669554" },
        { "supplier": { "id": "tripadvisor" }, "id": "3166269" },
        { "supplier": { "id": "yelp" }, "id": "6SvL6NOKrknf9aTGK6f2Xw" }
      ],
      "highlights": { "title": [ ], "address": { "label": [ ] } }
    }
  ],
  "queryTerms": [ ]
}

追加情報

/autosuggest パラメータの詳細については、次のトピックを参照してください。 API リファレンス

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

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