shirawebill
AWS location geocoding returning error
Hi, I am trying to use AWS to geocode with input, but I am getting errors, I think there is something wrong with my syntax, but I cannot figure out what:
My code:
- client = AWS.Client.create(System.fetch_env!(“AWS_ACCESS_KEY_ID”), System.fetch_env!
(“AWS_SECRET_ACCESS_KEY”), “eu-west-1”) - AWS.Location.search_place_index_for_text(client, “site_addresses”, “2 Water Lane”)
“site_addresses” is my index name and the address I am searching is “2 Water Lane”
I am following the docs:
This is the error I am getting back:
Thanks! ![]()
Marked As Solved
al2o3cr
FWIW, posting log output in triple-backticks (```) will format it nicely and is more readable than a screenshot.
In this case the important part is at the very end of the line that wraps:
and is_map(payload)
The AWS request machinery expects a map shaped like the payload in the AWS docs:
{
"Text": "Any Town",
"MaxResults": 10
}
Your second line could be instead:
AWS.Location.search_place_index_for_text(client, “site_addresses”, %{"Text" => “2 Water Lane”})
Also Liked
philss
The root cause was that we were not considering the “host prefix” some services require it. The problem is now fixed in version 0.13.0 of the AWS package. Thanks @shirawebill for reporting this! ![]()








