shirawebill

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:

  1. client = AWS.Client.create(System.fetch_env!(“AWS_ACCESS_KEY_ID”), System.fetch_env!
    (“AWS_SECRET_ACCESS_KEY”), “eu-west-1”)
  2. 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! :smiley:

Marked As Solved

al2o3cr

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

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! :slight_smile:

Where Next?

Popular in Questions Top

srinivasu
How to handle excepions in elixir? Suppose i have A, B, C ,D, E modules. and each module has get() function. A.get() method will call th...
New
aalberti333
As the title describes, I’m trying to run Enum.map() over a list of key/value pairs, where the value is a map. My data looks like this: ...
New
vertexbuffer
Hello, can anybody help here..? I have a list of players and I what to delete an element, but every for loop the list is reverting to ori...
New
mcarvalho
What is the difference between System.get_env and Application.get_env? For example, what are best practices to use one versus another.
New
aadeshere1
I have a another noob question about loop. Since elixir is immutable, while loop is not directly possible. total = 10 while total != 0 ...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
qwerescape
Is there a way to get the call stack or stack trace at any point in the code? Not from exceptions, but an expression that returns how the...
New
fayddelight
I tried installing elixir 1.11.2 erlang 23.3.4 via asdf in my zsh shell. Enabled the versions locally and globally. When I list them ...
New
stefanluptak
Hello everybody, usually, I use a 29" ultra-wide monitor for VSCode which can easily accomodate explorer (files panel) + file with code ...
New
joeerl
Hello again - after a longish gap I’ve decided I really must dig into Elixir and see what’s been happening here - so I have a few questio...
New

Other popular topics Top

JDanielMartinez
Hi! May someone helps me, please! I have two apps into an umbrella project: the first one is Database, which manages queries, and the se...
New
yawaramin
In the Dialyzer docs ( http://erlang.org/doc/man/dialyzer.html#requesting-or-suppressing-warnings-in-source-files ), there is a way to tu...
New
openscript
Hello! Sorry for this astonishing simple question, but I’m really stuck. I try to set up the intellij-elixir plugin, but I don’t know ho...
New
joaquinalcerro
Hi there, I am working with Ecto-Postgresql and I need to call all of the records from a specific table but the table has 40,000 record...
New
axelson
This post is a wiki (feel free to hit the edit button near the bottom right of this post to add your own changes!) This post collects co...
239 45766 226
New
script
If I have a string “1000 cfu/ml” . I want to remove the characters and / and space . So the string is like this "1000" What is the ...
New
rms.mrcs
Hi, I need to transform a list of numbers into a map where the keys are the indexes and the values are the original values of the list....
New
skosch
To my knowledge, put_in, Map.update etc. all have the one limitation of not automatically creating intermediate keys when needed (for exa...
New
lucidguppy
I have a super simple question about elixir - how would I take a file like this foo bar baz and output a new file that enumerates th...
New
jay1
Why is it that the mnesia database isn’t the most preferred database for use in Elixir/Phoenix?
New

We're in Beta

About us Mission Statement