Skip to content

Latest commit

 

History

History
70 lines (48 loc) · 1.76 KB

README.md

File metadata and controls

70 lines (48 loc) · 1.76 KB

Geocoder Build Status Inline docs Coverage Status

A simple, efficient geocoder/reverse geocoder with a built-in cache.

Is it extensible? Yes. Is it any good? Absolutely.

Installation

Keep calm and add Geocoder to your mix.exs dependencies:

def deps do
  [{:geocoder, "~> 0.7"}]
end

Add it to your starting applications too:

def application do
  [applications: [:logger, :geocoder]]
end

Set pool configuration:

config :geocoder, :worker_pool_config, [
  size: 4,
  max_overflow: 2
]

Set provider configuration:

config :geocoder, :worker, [
  provider: Geocoder.Providers.GoogleMaps # is the default, or OpenStreetMaps
]

Let's rumble!

Usage

Geocoder.call("Toronto, ON")
Geocoder.call({43.653226, -79.383184})

You can pass options to the function that will be passed to the geocoder provider, for example:

Geocoder.call(address: "Toronto, ON", language: "es", key: "...", ...)

See here and here for a list of supported parameters for the default geocoder provider (Geocoder.Provider.GoogleMaps).

And you're done! How simple was that?

Copyright and License

Copyright (c) 2015, Kash Nouroozi.

The source code is licensed under the MIT License.