Popularity
2.9
Growing
Activity
0.0
Stable
12
2
4

Description

The OpenCage geocoding API supports forward and reverse geocoding for the entire world and is based on various open datasources like OpenStreetMap.

Monthly Downloads: 140
Programming language: Elixir
License: MIT License
Tags: Geocoding     OpenCage     Geo     Opendata    

README

OpenCagex

Build Status Hex Version

An OpenCage Geocoder API wrapper written in Elixir

Installation

  1. Add open_cagex to your list of dependencies in mix.exs:
  def deps do
    [{:open_cagex, "~> 0.1.0"}]
  end

Usage

iex> OpenCagex.set_api_key("YOUR API KEY")
:ok
iex> OpenCagex.geocode("Passatge de la Pau, Barcelona")
{:ok, %{"lat" => 41.3778504, "lng" => 2.1778608}}

iex> OpenCagex.reverse(41.3780845, 2.1751182)
{:ok, "Moog, Carrer de l'Arc del Teatre, 3, 08001 Barcelona, Spain"}

Documentation can be found on HexDocs.

Running locally

Clone the repository

git clone [email protected]:dsantosmerino/open-cagex.git

Install dependencies

cd open_cagex
mix deps.get

To run the tests

mix test

To run the lint

mix credo