位置を使用して住所を検索する
このチュートリアルでは、既知の位置を使用して住所を検索する方法を説明します。
手順
地理的位置(52.62621,13.51700)から「Brandenburgische Straße 125, Schöneiche」を検索するには、
次のリクエストを送信します。
GET https://discover.search.hereapi.com/v1/
discover
?at=52.62621,13.51700
&q=Brandenburgische+Stra%C3%9Fe+125%2C+Sch%C3%B6neiche
&apiKey={YOUR_API_KEY}次のパラメーターを使用します。
- at - 座標で表される検索コンテキストの中心を指定します。
- q - 名前を入力します。
- apiKey - APIキー。
注
このリクエストはAPIキー認証を使用します。HEREプラットフォームの認証オプションの詳細については、「Identity & Access Management Guide」(IDとアクセス管理ガイド)を参照してください。
結果には、関連する位置情報オブジェクトについての詳細情報が表示されます。
{
"items": [
{
"title": "Brandenburgische Straße 125, 15566 Schöneiche bei Berlin, Deutschland",
"id": "here:af:streetsection:IXpGmsnsmtABEAIboP-wiC:CgcIBCCBuI1XEAEaAzEyNShk",
"resultType": "houseNumber",
"houseNumberType": "PA",
"address": {
"label": "Brandenburgische Straße 125, 15566 Schöneiche bei Berlin, Deutschland",
"countryCode": "DEU",
"countryName": "Deutschland",
"stateCode": "BB",
"state": "Brandenburg",
"countyCode": "LOS",
"county": "Oder-Spree",
"city": "Schöneiche bei Berlin",
"district": "Schöneiche bei Berlin",
"street": "Brandenburgische Straße",
"postalCode": "15566",
"houseNumber": "125"
},
"position": { "lat": 52.47427, "lng": 13.69919 },
"access": [{ "lat": 52.47429, "lng": 13.69893 }],
"distance": 20909,
"mapView": { "west": 13.69767, "south": 52.4563, "east": 13.70003, "north": 52.47889 }
}
]
}追加情報
/discoverエンドポイントパラメーターの詳細については、「APIリファレンス」を参照してください。
4 日前の更新