ExAlice
WARNING: This is alpha software, do not use in production!
Installation of exalice from this repository
Ensure that Elasticsearch 2.2.x is installed
Ensure that the analysis-icu plugin is installed:
sudo /usr/share/elasticsearch/bin/plugin install analysis-icu
The path might vary between different operating systemsEnsure that Elasticsearch is started
Run the import (after fetching deps, and compiling everything):
mix exalice.bootstrap # Populate the storage with sample data in this repository
When exalice is used as an external dependency in your application
Add exalice to your list of dependencies in
mix.exs:def deps do
[{:exalice, "~> 0.0.1-alpha"}]end
Ensure exalice is started before your application:
def application do
[applications: [:exalice]]end
Ensure that Elasticsearch 2.2.x is installed
Ensure that the analysis-icu plugin is installed:
sudo /usr/share/elasticsearch/bin/plugin install analysis-icu
The path might vary between different operating systemsEnsure that Elasticsearch is started
Add to your config/config.exs:
config :exalice,
provider: ExAlice.Geocoder.Providers.Elastic,
geocoder: ExAlice.Geocoder.Providers.GoogleMaps,
index: :exalice,
doc_type: :location,
file: "data/germany-streets.json",
chunks: 5000(optional) Put a json file generated with pbf2json from openstreetmap pbf(s) in your
data/folderCopy the germany-streets.json sample extract in your local
data/folder inside your applicationRun mix exalice.bootstrap
To geocode an address execute:
Run
iex -S mixType
ExAlice.Geocoder.geocode("Via Recoaro 3, Broni")You should receive back data from google maps
If you run again
ExAlice.Geocoder.geocode("Via Recoaro 3, Broni")you should receive back data from the storage (no google maps lookup)
NOTE: At the moment the geocoder relies on google maps and there's no possibility to use a google maps api key.