sergey-chechaev / elixir_geocoder

0 stars 0 forks source link

development plans #1

Open sobolevn opened 7 years ago

sobolevn commented 7 years ago

I think it would be a good idea to start with the geocoders providers API research. What functionality do they provide? How does it differ from one to another? What are the limitations?

I see this basic API as behaviour declaration. We could separate the providers the same way as ueberauth did with their providers. So this mechanism would be simple and extendable.

What do you think?

sergey-chechaev commented 7 years ago

@sobolevn Ueberauth it is good idea. But I think about config file where you can choose geocoding service, ip service, units (km or miles), etc. Example:

MyConfig.config do
  # geocoding service 
  config.lookup :yandex
  config.ip_service :freegeoip
  config.units :km
  ...
end

Example of searching

# Search by city (Yandex)
Geocoder.search("Moscow")
# Search by ip (Freegeoip)
Geocoder.search("127.0.0.1")

And what do you think?