AWS.GeoPlaces reference
Autocomplete
Section titled “Autocomplete”Source:
src/AWS/GeoPlaces/Autocomplete.ts
Runtime binding for geo-places:Autocomplete — complete potential places
and addresses as the user types, based on partial input.
geo-places is a standalone, pay-per-call Amazon Location API with no
resource to manage: the binding takes no arguments and grants the function
geo-places:Autocomplete. Requests and responses are raw distilled types
(no marshalling).
Autocomplete: Autocompleting Queries
Section titled “Autocomplete: Autocompleting Queries”Provide the AutocompleteHttp implementation layer on the Function effect
(.pipe(Effect.provide(AWS.GeoPlaces.AutocompleteHttp))), bind in the init
phase, then call the client at runtime.
// initconst autocomplete = yield* AWS.GeoPlaces.Autocomplete();
// runtimeconst result = yield* autocomplete({ QueryText: "1600 Pennsylvania", MaxResults: 5,});const first = result.ResultItems?.[0]?.Title;Geocode
Section titled “Geocode”Source:
src/AWS/GeoPlaces/Geocode.ts
Runtime binding for geo-places:Geocode — convert an address or place
description into geographic coordinates.
geo-places is a standalone, pay-per-call Amazon Location API with no
resource to manage: the binding takes no arguments and grants the function
geo-places:Geocode. Requests and responses are raw distilled types (no
marshalling).
Geocode: Geocoding Addresses
Section titled “Geocode: Geocoding Addresses”Provide the GeocodeHttp implementation layer on the Function effect
(.pipe(Effect.provide(AWS.GeoPlaces.GeocodeHttp))), bind in the init
phase, then call the client at runtime.
// initconst geocode = yield* AWS.GeoPlaces.Geocode();
// runtimeconst result = yield* geocode({ QueryText: "1600 Pennsylvania Ave NW, Washington, DC",});const position = result.ResultItems?.[0]?.Position; // [lng, lat]GetPlace
Section titled “GetPlace”Source:
src/AWS/GeoPlaces/GetPlace.ts
Runtime binding for geo-places:GetPlace — fetch the full details of a
place (address, contacts, opening hours, time zone, …) by its PlaceId,
as returned by Geocode, SearchText, SearchNearby, Suggest, or
Autocomplete.
geo-places is a standalone, pay-per-call Amazon Location API with no
resource to manage: the binding takes no arguments and grants the function
geo-places:GetPlace. Requests and responses are raw distilled types (no
marshalling).
GetPlace: Fetching Place Details
Section titled “GetPlace: Fetching Place Details”Provide the GetPlaceHttp implementation layer on the Function effect
(.pipe(Effect.provide(AWS.GeoPlaces.GetPlaceHttp))), bind in the init
phase, then call the client at runtime.
// initconst geocode = yield* AWS.GeoPlaces.Geocode();const getPlace = yield* AWS.GeoPlaces.GetPlace();
// runtimeconst geocoded = yield* geocode({ QueryText: "Space Needle, Seattle" });const placeId = geocoded.ResultItems?.[0]?.PlaceId;const place = yield* getPlace({ PlaceId: placeId! });const label = place.Address?.Label;ReverseGeocode
Section titled “ReverseGeocode”Source:
src/AWS/GeoPlaces/ReverseGeocode.ts
Runtime binding for geo-places:ReverseGeocode — convert geographic
coordinates into a human-readable address or place, with optional filtering
by place type and additional features such as time zones.
geo-places is a standalone, pay-per-call Amazon Location API with no
resource to manage: the binding takes no arguments and grants the function
geo-places:ReverseGeocode. Requests and responses are raw distilled types
(no marshalling).
ReverseGeocode: Reverse Geocoding
Section titled “ReverseGeocode: Reverse Geocoding”Provide the ReverseGeocodeHttp implementation layer on the Function effect
(.pipe(Effect.provide(AWS.GeoPlaces.ReverseGeocodeHttp))), bind in the
init phase, then call the client at runtime.
// initconst reverseGeocode = yield* AWS.GeoPlaces.ReverseGeocode();
// runtimeconst result = yield* reverseGeocode({ QueryPosition: [-122.3381, 47.6101], // [longitude, latitude] MaxResults: 1,});const address = result.ResultItems?.[0]?.Address?.Label;SearchNearby
Section titled “SearchNearby”Source:
src/AWS/GeoPlaces/SearchNearby.ts
Runtime binding for geo-places:SearchNearby — find places around a
geographic position, optionally filtered by radius, bounding box,
categories, or food types.
geo-places is a standalone, pay-per-call Amazon Location API with no
resource to manage: the binding takes no arguments and grants the function
geo-places:SearchNearby. Requests and responses are raw distilled types
(no marshalling).
SearchNearby: Searching Nearby Places
Section titled “SearchNearby: Searching Nearby Places”Provide the SearchNearbyHttp implementation layer on the Function effect
(.pipe(Effect.provide(AWS.GeoPlaces.SearchNearbyHttp))), bind in the
init phase, then call the client at runtime.
// initconst searchNearby = yield* AWS.GeoPlaces.SearchNearby();
// runtimeconst result = yield* searchNearby({ QueryPosition: [-122.3493, 47.6205], // [lng, lat] QueryRadius: 1000, MaxResults: 5,});const titles = result.ResultItems?.map((item) => item.Title);SearchText
Section titled “SearchText”Source:
src/AWS/GeoPlaces/SearchText.ts
Runtime binding for geo-places:SearchText — free-form place search that
returns ranked results (POIs, addresses, streets) for a text query.
geo-places is a standalone, pay-per-call Amazon Location API with no
resource to manage: the binding takes no arguments and grants the function
geo-places:SearchText. Requests and responses are raw distilled types (no
marshalling).
SearchText: Searching Places
Section titled “SearchText: Searching Places”Provide the SearchTextHttp implementation layer on the Function effect
(.pipe(Effect.provide(AWS.GeoPlaces.SearchTextHttp))), bind in the init
phase, then call the client at runtime.
// initconst searchText = yield* AWS.GeoPlaces.SearchText();
// runtimeconst result = yield* searchText({ QueryText: "Space Needle, Seattle", MaxResults: 5,});const first = result.ResultItems?.[0];Suggest
Section titled “Suggest”Source:
src/AWS/GeoPlaces/Suggest.ts
Runtime binding for geo-places:Suggest — suggest places and query
refinements for a free-form (possibly misspelled or partial) query,
ranked by relevance. Unlike Autocomplete, Suggest returns place
suggestions (with PlaceIds) and query suggestions, tuned for
point-of-interest discovery.
geo-places is a standalone, pay-per-call Amazon Location API with no
resource to manage: the binding takes no arguments and grants the function
geo-places:Suggest. Requests and responses are raw distilled types (no
marshalling).
Suggest: Suggesting Places
Section titled “Suggest: Suggesting Places”Provide the SuggestHttp implementation layer on the Function effect
(.pipe(Effect.provide(AWS.GeoPlaces.SuggestHttp))), bind in the init
phase, then call the client at runtime.
// initconst suggest = yield* AWS.GeoPlaces.Suggest();
// runtimeconst result = yield* suggest({ QueryText: "coffee", BiasPosition: [-122.3493, 47.6205], // [lng, lat] MaxResults: 5,});const first = result.ResultItems?.[0]?.Title;