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의 유효한 값은 District, Locality, RegionSubRegion입니다.

  • 각 번역에는 (공식 이름), Abbreviation, BaseName (다른 언어로 Exonym 번역), Shortened또는 등 이름 변형의 종류를 나타내는 Type 필드가 포함됩니다Synonym.

  • Primary 필드는 지정된 언어의 기본 이름 변형을 나타냅니다.