Skip to content

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).

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.

// init
const reverseGeocode = yield* AWS.GeoPlaces.ReverseGeocode();
// runtime
const result = yield* reverseGeocode({
QueryPosition: [-122.3381, 47.6101], // [longitude, latitude]
MaxResults: 1,
});
const address = result.ResultItems?.[0]?.Address?.Label;