View a markdown version of this page

アドレス変換を取得する方法 - Amazon Location Service

翻訳は機械翻訳により提供されています。提供された翻訳内容と英語版の間で齟齬、不一致または矛盾がある場合、英語版が優先します。

アドレス変換を取得する方法

AddressTranslations では、使用可能なすべての言語でアドレスコンポーネントのすべての名前変換と代替名を取得できます。AddressTranslations リクエストパラメータを使用して、変換するアドレスコンポーネントを指定します。

想定されるユースケース

  • 多言語アプリケーション: 国際ユーザー向けにアドレスコンポーネントを複数言語で表示します。

  • ローカリゼーション: 都市とリージョンのローカル言語名とuser-preferred-language名の両方を表示します。

Sample request
{ "QueryText": "1 Rue de Rivoli, Paris", "AddressTranslations": ["Locality", "Region"] }
Sample response
{ "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointAddress", "Title": "1 Rue de Rivoli, 75004 Paris, France", "Translations": { "Locality": [ { "Names": [ { "Value": "Paris", "Language": "fr", "Type": "BaseName", "Primary": true }, { "Value": "Parigi", "Language": "it", "Type": "Exonym" }, { "Value": "パリ", "Language": "ja", "Type": "Exonym" } ], "Preference": "Primary" } ], "Region": [ { "Names": [ { "Value": "Île-de-France", "Language": "fr", "Type": "BaseName", "Primary": true }, { "Value": "IDF", "Language": "fr", "Type": "Abbreviation" } ], "Preference": "Primary" } ] } } ] }
cURL
curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryText": "1 Rue de Rivoli, Paris", "AddressTranslations": ["Locality", "Region"] }'
AWS CLI
aws geo-places geocode --key ${YourKey} --query-text "1 Rue de Rivoli, Paris" --address-translations Locality Region

デベロッパー向けのヒント

  • AddressTranslations の有効値は、DistrictLocalityRegionSubRegion です。

  • 各翻訳には、名前バリアントの種類を示すTypeフィールドが含まれます。BaseName(正式名称)Abbreviation、、 Exonym (別の言語への翻訳)、Shortened、または ですSynonym

  • Primary フィールドは、特定の言語のプライマリ名バリアントを示します。