From ccbfc7feef10f96a5761875b4d90566bf0b543b5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20B=C3=B8tker=20H=C3=B8j?= <christian@skeize.dk> Date: Thu, 16 Oct 2014 10:04:10 +0200 Subject: [PATCH] Add description of how to use GeoLite2 for IP geocoding --- README.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/README.md b/README.md index 13107688..9c282efe 100644 --- a/README.md +++ b/README.md @@ -717,6 +717,24 @@ You can replace `city` with `country` in any of the above tasks, generators, and * **Limitations**: Only good for non-commercial use. For commercial usage please check http://developer.baidu.com/map/question.htm#qa0013 * **Notes**: To use Baidu set `Geocoder.configure(:lookup => :baidu_ip, :api_key => "your_api_key")`. +#### GeoLite2 (`:geolite2`) - EXPERIMENTAL + +This lookup provides methods for geocoding IP addresses without making a call to a remote API (improves speed and availability). It works, but support is new and should not be considered production-ready. Please [report any bugs](https://github.com/alexreisner/geocoder/issues) you encounter. + +* **API key**: none (requires the free GeoLite2 City or Country MaxMind DB binary database which can be downloaded from [MaxMind](http://dev.maxmind.com/geoip/geoip2/geolite2/)) +* **Quota**: none +* **Region**: world +* **SSL support**: N/A +* **Languages**: English +* **Documentation**: http://www.maxmind.com/en/city +* **Terms of Service**: ? +* **Limitations**: ? +* **Notes**: **You must download a database from MaxMind and set the `:file` configuration option for local lookups to work.** The GeoLite2 CSV format is not yet supported since it is still in alpha stage. + +**To use the binary database** you must add the *[hive_geoip2](https://rubygems.org/gems/hive_geoip2)* gem to your Gemfile or have it installed in your system, and specify the path of the MaxMind database in your configuration. For example: + + Geocoder.configure(ip_lookup: :geolite2, geolite2: { file: File.join('folder', 'GeoLite2-City.mmdb') }) + Caching ------- -- GitLab