pure_geocoder v0.1.1 PureGeocoder

A module that geocodes addresses and reverse geocodes coordinates.

Link to this section Summary

Functions

Geocodes an address

Reverse geocodes a pair of coordinates

Link to this section Functions

Link to this function geocode(string)

Geocodes an address.

Returns {:ok, %{lat: longitude, lng: latitude}} or {:error, reason}

Examples

iex> PureGeocoder.geocode("350 5th Ave, New York, NY 10118")
{:ok, %{lat: 40.7483271, lng: -73.9856549}}
Link to this function reverse_geocode(arg1)

Reverse geocodes a pair of coordinates.

Returns {:ok, address} or {:error, reason}

Examples

iex> PureGeocoder.geocode(%{lat: 40.7483271, lng: -73.9856549})
{:ok, "350 5th Avenue, NYC, New York, 10018, USA"}

iex> PureGeocoder.geocode({40.7483271, -73.9856549})
{:ok, "350 5th Avenue, NYC, New York, 10018, USA"}

iex> PureGeocoder.geocode(40.7483271, -73.9856549)
{:ok, "350 5th Avenue, NYC, New York, 10018, USA"}
Link to this function reverse_geocode(lat, lng)