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).
Geocoding Addresses
Section titled “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]