So geokodieren Sie eine Adresse - Amazon Location Service

Die vorliegende Übersetzung wurde maschinell erstellt. Im Falle eines Konflikts oder eines Widerspruchs zwischen dieser übersetzten Fassung und der englischen Fassung (einschließlich infolge von Verzögerungen bei der Übersetzung) ist die englische Fassung maßgeblich.

So geokodieren Sie eine Adresse

Mit der Geocode-API können Sie eine bestimmte Punktadresse, eine interpolierte Adresse oder eine Straße geokodieren. Die API-Antwort enthält Standortinformationen, einschließlich geografischer Koordinaten und Übereinstimmungswerte, die angeben, wie genau das Ergebnis mit der Abfrage übereinstimmt.

Mögliche Anwendungsfälle

  • Saubere Adressdatenbank: Verbessern Sie die Datenqualität, indem Sie Fehler in Adressdatensätzen identifizieren und korrigieren.

  • Normalisieren und standardisieren Sie Adressen: Sorgen Sie für eine konsistente Adressformatierung in allen Datensätzen, um die Dateninteroperabilität zu verbessern.

  • Adressen mit zusätzlichen Informationen anreichern: Fügen Sie geografische Koordinaten und andere relevante Details zu Adressdatensätzen hinzu, um standortbezogene Analysen und Erkenntnisse zu unterstützen.

Beispiele

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"}'

Tipps für Entwickler

Verwenden Sie Filter wie IncludeCountries undIncludePlaceTypes, um genaue Ergebnisse zu erhalten. Wenn Sie beispielsweise Vancouver aus den USA benötigen, bewerben Sie sich, "IncludeCountries": ["USA"] um die Ergebnisse in den USA zu priorisieren. Weitere Informationen hierzu finden Sie unter So geokodieren Sie mithilfe von Filtern.

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