アドレスをジオコードする方法 - Amazon Location Service

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

アドレスをジオコードする方法

Geocode API を使用すると、特定のポイントアドレス、補間されたアドレス、または通りをジオコードできます。API レスポンスには、地理的座標や一致スコアなど、結果がクエリとどの程度正確に一致しているかを示す位置情報が含まれています。

潜在的なユースケース

  • アドレスデータベースのクリーンアップ: アドレスレコードのエラーを特定して修正することで、データ品質を向上させます。

  • アドレスの正規化と標準化: データ相互運用性を向上させるために、データセット間で一貫したアドレスフォーマットを確保します。

  • アドレスを追加情報で強化する: 地理的座標やその他の関連する詳細を追加してレコードに対処し、ロケーションベースの分析とインサイトをサポートします。

Sample request
{ "QueryText": "510 W Georgia St, Vancouver, BC" }
Sample response
{ "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointAddress", "Title": "510 W Georgia St, Vancouver, BC V6B 0M3, Canada", "Address": { "Label": "510 W Georgia St, Vancouver, BC V6B 0M3, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", "District": "Downtown Vancouver", "PostalCode": "V6B 0M3", "Street": "W Georgia St", "StreetComponents": [ { "BaseName": "Georgia", "Type": "St", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "W", "Language": "en" } ], "AddressNumber": "510" }, "Position": [ -123.11694, 49.28126 ], "MapView": [ -123.11832, 49.28036, -123.11556, 49.28216 ], "AccessPoints": [ { "Position": [ -123.11656, 49.28151 ] } ], "MatchScores": { "Overall": 1, "Components": { "Address": { "Region": 1, "Locality": 1, "Intersection": [ 1 ], "AddressNumber": 1 } } } } ] }
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": "510 W Georgia St, Vancouver, BC"}'
AWS CLI
aws geo-places geocode --key ${YourAPIKey} --query-text "510 W Georgia St, Vancouver, BC"
Sample request
{ "QueryComponents": { "AddressNumber": "510", "Locality": "Vancouver", "Region": "BC", "Country": "Canada", "Street": "Georgia" } }
Sample response
{ "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointAddress", "Title": "510 W Georgia St, Vancouver, BC V6B 0M3, Canada", "Address": { "Label": "510 W Georgia St, Vancouver, BC V6B 0M3, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", "District": "Downtown Vancouver", "PostalCode": "V6B 0M3", "Street": "W Georgia St", "StreetComponents": [ { "BaseName": "Georgia", "Type": "St", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "W", "Language": "en" } ], "AddressNumber": "510" }, "Position": [ -123.11694, 49.28126 ], "MapView": [ -123.11832, 49.28036, -123.11556, 49.28216 ], "AccessPoints": [ { "Position": [ -123.11656, 49.28151 ] } ], "MatchScores": { "Overall": 0.99, "Components": { "Address": { "Country": 1, "Region": 1, "Locality": 1, "Intersection": [ 0.78 ], "AddressNumber": 1 } } } }, { "PlaceId": "<Redacted>", "PlaceType": "InterpolatedAddress", "Title": "510 E Georgia St, Vancouver, BC V6A 1Z9, Canada", "Address": { "Label": "510 E Georgia St, Vancouver, BC V6A 1Z9, Canada", "Country": { "Code2": "CA", "Code3": "CAN", "Name": "Canada" }, "Region": { "Code": "BC", "Name": "British Columbia" }, "SubRegion": { "Name": "Metro Vancouver" }, "Locality": "Vancouver", "District": "Strathcona", "PostalCode": "V6A 1Z9", "Street": "E Georgia St", "StreetComponents": [ { "BaseName": "Georgia", "Type": "St", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "E", "Language": "en" } ], "AddressNumber": "510" }, "Position": [ -123.0932, 49.27829 ], "MapView": [ -123.09458, 49.27739, -123.09182, 49.27919 ], "AccessPoints": [ { "Position": [ -123.0932, 49.27842 ] } ], "MatchScores": { "Overall": 0.99, "Components": { "Address": { "Country": 1, "Region": 1, "Locality": 1, "Intersection": [ 0.78 ], "AddressNumber": 1 } } } } ] }
cURL
curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/geocode?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{"QueryComponents": {"AddressNumber": "510", "Locality": "Vancouver", "Region": "BC", "Country": "Canada", "Street": "Georgia"}}'
AWS CLI
./aws geo-places geocode --key ${YourAPIKey} --query-components '{ "AddressNumber" : "510", "Locality": "vancouver", "Region": "BC", "Country": "Canada", "Street": "Georgia"}'
Sample request
{ "QueryText": "W. 6th St", "QueryComponents": { "AddressNumber": "415", "Locality": "Vancouver" } }
Sample response
{ "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointAddress", "Title": "415 W 6th St, Vancouver, WA 98660-3375, United States", "Address": { "Label": "415 W 6th St, Vancouver, WA 98660-3375, United States", "Country": { "Code2": "US", "Code3": "USA", "Name": "United States" }, "Region": { "Code": "WA", "Name": "Washington" }, "SubRegion": { "Name": "Clark" }, "Locality": "Vancouver", "District": "Esther Short", "PostalCode": "98660-3375", "Street": "W 6th St", "StreetComponents": [ { "BaseName": "6th", "Type": "St", "TypePlacement": "AfterBaseName", "TypeSeparator": " ", "Prefix": "W", "Language": "en" } ], "AddressNumber": "415" }, "Position": [ -122.67543, 45.62527 ], "MapView": [ -122.67672, 45.62437, -122.67414, 45.62617 ], "AccessPoints": [ { "Position": [ -122.67543, 45.62506 ] } ], "MatchScores": { "Overall": 1, "Components": { "Address": { "Locality": 1, "Intersection": [ 1 ], "AddressNumber": 1 } } } } ] }
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": "W. 6th St", "QueryComponents": {"AddressNumber": "415", "Locality": "Vancouver"}}'
AWS CLI
./aws geo-places geocode -key ${YourAPIKey} --query-text "W. 6th St" \ --query-components '{"AddressNumber" : "415", "Locality": "Vancouver"}'

開発者向けのヒント

IncludeCountries や などのフィルターIncludePlaceTypesを使用して正確な結果を取得します。たとえば、米国のバンクーバーが必要な場合は、 を申請"IncludeCountries": ["USA"]して米国の結果を優先します。詳細についてはフィルターを使用してジオコーディングする方法を参照してください。

{ "QueryText": "Vancouver", "Filter": { "IncludeCountries": ["USA"], "IncludePlaceTypes": ["City"] } }