Come cercare luoghi vicini in base alla categoria - Servizio di posizione Amazon

Le traduzioni sono generate tramite traduzione automatica. In caso di conflitto tra il contenuto di una traduzione e la versione originale in Inglese, quest'ultima prevarrà.

Come cercare luoghi vicini in base alla categoria

L' SearchNearby API consente l'interrogazione di punti di interesse (POI) con l'inclusione o l'esclusione di categorie specifiche. Questo può aiutare gli utenti a esplorare quartieri, scoprire luoghi locali e POIs altro ancora. L'API richiede unQueryPosition, che può essere basato sulla posizione del dispositivo, sulla posizione IP o sul centro della visualizzazione della mappa. In alternativa, gli utenti possono specificare una città o un luogo e l'applicazione distorcerà i risultati in base alle coordinate di quella posizione.

Per ulteriori informazioni sulle categorie supportate, consultaFiltri per categorie.

Casi d'uso potenziali

  • Esplora le strutture locali: trova le strutture disponibili all'interno di un quartiere.

  • Scopri le attrazioni turistiche: identifica i luoghi turistici all'interno di una città.

  • Pianifica un viaggio in una città: organizza viaggi diversi POIs all'interno di una città prescelta.

Esempi

Sample request
{ "QueryPosition": [ 4.35609, 50.84439 ], "Filter": { "IncludeCategories": ["airport"] } }
Sample response
{ "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Brussels Airport", "Address": { "Label": "Brussels Airport, A201, 1930 Zaventem, België", "Country": { "Code2": "BE", "Code3": "BEL", "Name": "België" }, "Region": { "Code": "VLG", "Name": "Vlaanderen" }, "SubRegion": { "Name": "Vlaams Brabant" }, "Locality": "Zaventem", "PostalCode": "1930", "Street": "A201", "StreetComponents": [ { "BaseName": "A201", "Language": "nl" } ] }, "Position": [ 4.47767, 50.89452 ], "Distance": 10191, "Categories": [ { "Id": "airport", "Name": "Airport", "LocalizedName": "Luchthaven", "Primary": true } ] }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Internationale Luchthaven Antwerpen", "Address": { "Label": "Internationale Luchthaven Antwerpen, Luchthavenlei 1, 2100 Antwerpen, België", "Country": { "Code2": "BE", "Code3": "BEL", "Name": "België" }, "Region": { "Code": "VLG", "Name": "Vlaanderen" }, "SubRegion": { "Name": "Antwerpen" }, "Locality": "Antwerpen", "District": "Deurne", "PostalCode": "2100", "Street": "Luchthavenlei", "StreetComponents": [ { "BaseName": "Luchthaven", "Type": "lei", "TypePlacement": "AfterBaseName", "TypeSeparator": "", "Language": "nl" } ], "AddressNumber": "1" }, "Position": [ 4.45083, 51.18867 ], "Distance": 38852, "Categories": [ { "Id": "airport", "Name": "Airport", "LocalizedName": "Luchthaven", "Primary": true } ] } ] }
cURL
curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-nearby?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryPosition": [ 4.35609, 50.84439 ], "Filter": { "IncludeCategories": ["airport"] }, "MaxResults": 2 }
AWS CLI
aws geo-places search-nearby --key ${YourKey} \ --query-position 4.35609 50.84439 \ --filter '{"IncludeCategories": ["airport"]}' \ --max-results 2
Sample request
{ "QueryPosition": [ 4.35609, 50.84439 ], "Filter": { "ExcludeCategories": ["airport"] } }
Sample response
{ "ResultItems": [ { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Socialbrands Module 2", "Address": { "Label": "Socialbrands Module 2, Albertinaplein, 1000 Brussel, België", "Country": { "Code2": "BE", "Code3": "BEL", "Name": "België" }, "Region": { "Code": "BRU", "Name": "Brussel" }, "SubRegion": { "Name": "Brussel" }, "Locality": "Brussel", "District": "Koningswijk", "PostalCode": "1000", "Street": "Albertinaplein", "StreetComponents": [ { "BaseName": "Albertina", "Type": "plein", "TypePlacement": "AfterBaseName", "TypeSeparator": "", "Language": "nl" } ] }, "Position": [ 4.35609, 50.84439 ], "Distance": 0, "Categories": [ { "Id": "commercial_services", "Name": "Commercial Services", "LocalizedName": "Commerciële diensten", "Primary": true } ], "Contacts": { "Websites": [ { "Value": "https://oneread.net" } ] }, "AccessPoints": [ { "Position": [ 4.35609, 50.84439 ] } ] }, { "PlaceId": "<Redacted>", "PlaceType": "PointOfInterest", "Title": "Barman Privé", "Address": { "Label": "Barman Privé, Albertinaplein, 1000 Brussel, België", "Country": { "Code2": "BE", "Code3": "BEL", "Name": "België" }, "Region": { "Code": "BRU", "Name": "Brussel" }, "SubRegion": { "Name": "Brussel" }, "Locality": "Brussel", "District": "Koningswijk", "PostalCode": "1000", "Street": "Albertinaplein", "StreetComponents": [ { "BaseName": "Albertina", "Type": "plein", "TypePlacement": "AfterBaseName", "TypeSeparator": "", "Language": "nl" } ] }, "Position": [ 4.35609, 50.84439 ], "Distance": 0, "Categories": [ { "Id": "catering_and_other_food_services", "Name": "Catering and Other Food Services", "LocalizedName": "Catering- en horecadiensten", "Primary": true } ], "Contacts": { "Phones": [ { "Value": "+32476891634" } ] }, "OpeningHours": [ { "Display": [ "ma-zo: 00:00 - 24:00" ], "OpenNow": true, "Components": [ { "OpenTime": "T000000", "OpenDuration": "PT24H00M", "Recurrence": "FREQ:DAILY;BYDAY:MO,TU,WE,TH,FR,SA,SU" } ] } ], "AccessPoints": [ { "Position": [ 4.35609, 50.84439 ] } ] } ] }
cURL
curl --request POST \ --url 'https://places.geo.eu-central-1.amazonaws.com/v2/search-nearby?key=Your_Key' \ --header 'Content-Type: application/json' \ --data '{ "QueryPosition": [ 4.35609, 50.84439 ], "Filter": { "ExcludeCategories": ["airport"] } }
AWS CLI
aws geo-places search-nearby --key ${YourKey} \ --query-position 4.35609 50.84439 \ --filter '{"ExcludeCategories": ["airport"]}' \ --max-results 2