geocoder 1.1.9 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +5 -5
- data/CHANGELOG.md +309 -0
- data/LICENSE +1 -1
- data/README.md +544 -540
- data/bin/console +13 -0
- data/examples/app_defined_lookup_services.rb +22 -0
- data/examples/reverse_geocode_job.rb +40 -0
- data/lib/easting_northing.rb +171 -0
- data/lib/generators/geocoder/config/templates/initializer.rb +22 -16
- data/lib/generators/geocoder/maxmind/geolite_city_generator.rb +30 -0
- data/lib/generators/geocoder/maxmind/geolite_country_generator.rb +30 -0
- data/lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb +30 -0
- data/lib/generators/geocoder/maxmind/templates/migration/geolite_country.rb +17 -0
- data/lib/generators/geocoder/migration_version.rb +15 -0
- data/lib/geocoder/cache.rb +20 -32
- data/lib/geocoder/cache_stores/base.rb +40 -0
- data/lib/geocoder/cache_stores/generic.rb +35 -0
- data/lib/geocoder/cache_stores/redis.rb +34 -0
- data/lib/geocoder/calculations.rb +67 -36
- data/lib/geocoder/cli.rb +2 -2
- data/lib/geocoder/configuration.rb +33 -16
- data/lib/geocoder/configuration_hash.rb +4 -4
- data/lib/geocoder/esri_token.rb +38 -0
- data/lib/geocoder/exceptions.rb +19 -0
- data/lib/geocoder/ip_address.rb +33 -0
- data/lib/geocoder/kernel_logger.rb +25 -0
- data/lib/geocoder/logger.rb +47 -0
- data/lib/geocoder/lookup.rb +74 -11
- data/lib/geocoder/lookups/abstract_api.rb +46 -0
- data/lib/geocoder/lookups/amap.rb +63 -0
- data/lib/geocoder/lookups/amazon_location_service.rb +54 -0
- data/lib/geocoder/lookups/baidu.rb +24 -15
- data/lib/geocoder/lookups/baidu_ip.rb +30 -0
- data/lib/geocoder/lookups/ban_data_gouv_fr.rb +143 -0
- data/lib/geocoder/lookups/base.rb +109 -23
- data/lib/geocoder/lookups/bing.rb +45 -10
- data/lib/geocoder/lookups/db_ip_com.rb +52 -0
- data/lib/geocoder/lookups/dstk.rb +4 -2
- data/lib/geocoder/lookups/esri.rb +61 -8
- data/lib/geocoder/lookups/freegeoip.rb +25 -6
- data/lib/geocoder/lookups/geoapify.rb +72 -0
- data/lib/geocoder/lookups/geocoder_ca.rb +5 -6
- data/lib/geocoder/lookups/geocodio.rb +42 -0
- data/lib/geocoder/lookups/geoip2.rb +49 -0
- data/lib/geocoder/lookups/geoportail_lu.rb +65 -0
- data/lib/geocoder/lookups/google.rb +45 -12
- data/lib/geocoder/lookups/google_places_details.rb +64 -0
- data/lib/geocoder/lookups/google_places_search.rb +76 -0
- data/lib/geocoder/lookups/google_premier.rb +16 -2
- data/lib/geocoder/lookups/here.rb +73 -0
- data/lib/geocoder/lookups/ip2location.rb +71 -0
- data/lib/geocoder/lookups/ipapi_com.rb +82 -0
- data/lib/geocoder/lookups/ipdata_co.rb +62 -0
- data/lib/geocoder/lookups/ipgeolocation.rb +51 -0
- data/lib/geocoder/lookups/ipinfo_io.rb +44 -0
- data/lib/geocoder/lookups/ipqualityscore.rb +50 -0
- data/lib/geocoder/lookups/ipregistry.rb +68 -0
- data/lib/geocoder/lookups/ipstack.rb +63 -0
- data/lib/geocoder/lookups/latlon.rb +58 -0
- data/lib/geocoder/lookups/location_iq.rb +54 -0
- data/lib/geocoder/lookups/mapbox.rb +59 -0
- data/lib/geocoder/lookups/mapquest.rb +9 -10
- data/lib/geocoder/lookups/maxmind.rb +10 -8
- data/lib/geocoder/lookups/maxmind_geoip2.rb +70 -0
- data/lib/geocoder/lookups/maxmind_local.rb +71 -0
- data/lib/geocoder/lookups/melissa_street.rb +41 -0
- data/lib/geocoder/lookups/nationaal_georegister_nl.rb +38 -0
- data/lib/geocoder/lookups/nominatim.rb +26 -6
- data/lib/geocoder/lookups/opencagedata.rb +65 -0
- data/lib/geocoder/lookups/osmnames.rb +57 -0
- data/lib/geocoder/lookups/pelias.rb +63 -0
- data/lib/geocoder/lookups/photon.rb +89 -0
- data/lib/geocoder/lookups/pickpoint.rb +41 -0
- data/lib/geocoder/lookups/pointpin.rb +69 -0
- data/lib/geocoder/lookups/postcode_anywhere_uk.rb +50 -0
- data/lib/geocoder/lookups/postcodes_io.rb +31 -0
- data/lib/geocoder/lookups/smarty_streets.rb +68 -0
- data/lib/geocoder/lookups/telize.rb +75 -0
- data/lib/geocoder/lookups/tencent.rb +59 -0
- data/lib/geocoder/lookups/test.rb +4 -0
- data/lib/geocoder/lookups/twogis.rb +58 -0
- data/lib/geocoder/lookups/uk_ordnance_survey_names.rb +59 -0
- data/lib/geocoder/lookups/yandex.rb +18 -11
- data/lib/geocoder/models/active_record.rb +9 -4
- data/lib/geocoder/models/base.rb +1 -4
- data/lib/geocoder/models/mongo_base.rb +6 -4
- data/lib/geocoder/query.rb +23 -5
- data/lib/geocoder/railtie.rb +2 -2
- data/lib/geocoder/request.rb +102 -11
- data/lib/geocoder/results/abstract_api.rb +146 -0
- data/lib/geocoder/results/amap.rb +87 -0
- data/lib/geocoder/results/amazon_location_service.rb +57 -0
- data/lib/geocoder/results/baidu.rb +10 -14
- data/lib/geocoder/results/baidu_ip.rb +62 -0
- data/lib/geocoder/results/ban_data_gouv_fr.rb +282 -0
- data/lib/geocoder/results/base.rb +13 -1
- data/lib/geocoder/results/bing.rb +5 -1
- data/lib/geocoder/results/db_ip_com.rb +58 -0
- data/lib/geocoder/results/esri.rb +35 -8
- data/lib/geocoder/results/freegeoip.rb +2 -7
- data/lib/geocoder/results/geoapify.rb +179 -0
- data/lib/geocoder/results/geocoder_ca.rb +3 -3
- data/lib/geocoder/results/geocodio.rb +78 -0
- data/lib/geocoder/results/geoip2.rb +76 -0
- data/lib/geocoder/results/geoportail_lu.rb +71 -0
- data/lib/geocoder/results/google.rb +26 -0
- data/lib/geocoder/results/google_places_details.rb +39 -0
- data/lib/geocoder/results/google_places_search.rb +52 -0
- data/lib/geocoder/results/here.rb +77 -0
- data/lib/geocoder/results/ip2location.rb +22 -0
- data/lib/geocoder/results/ipapi_com.rb +45 -0
- data/lib/geocoder/results/ipdata_co.rb +40 -0
- data/lib/geocoder/results/ipgeolocation.rb +59 -0
- data/lib/geocoder/results/ipinfo_io.rb +48 -0
- data/lib/geocoder/results/ipqualityscore.rb +54 -0
- data/lib/geocoder/results/ipregistry.rb +304 -0
- data/lib/geocoder/results/ipstack.rb +60 -0
- data/lib/geocoder/results/latlon.rb +71 -0
- data/lib/geocoder/results/location_iq.rb +6 -0
- data/lib/geocoder/results/mapbox.rb +63 -0
- data/lib/geocoder/results/mapquest.rb +5 -8
- data/lib/geocoder/results/maxmind.rb +0 -5
- data/lib/geocoder/results/maxmind_geoip2.rb +9 -0
- data/lib/geocoder/results/maxmind_local.rb +44 -0
- data/lib/geocoder/results/melissa_street.rb +46 -0
- data/lib/geocoder/results/nationaal_georegister_nl.rb +62 -0
- data/lib/geocoder/results/nominatim.rb +41 -14
- data/lib/geocoder/results/opencagedata.rb +100 -0
- data/lib/geocoder/results/osmnames.rb +56 -0
- data/lib/geocoder/results/pelias.rb +58 -0
- data/lib/geocoder/results/photon.rb +119 -0
- data/lib/geocoder/results/pickpoint.rb +6 -0
- data/lib/geocoder/results/pointpin.rb +40 -0
- data/lib/geocoder/results/postcode_anywhere_uk.rb +42 -0
- data/lib/geocoder/results/postcodes_io.rb +40 -0
- data/lib/geocoder/results/smarty_streets.rb +142 -0
- data/lib/geocoder/results/telize.rb +40 -0
- data/lib/geocoder/results/tencent.rb +72 -0
- data/lib/geocoder/results/test.rb +20 -3
- data/lib/geocoder/results/twogis.rb +76 -0
- data/lib/geocoder/results/uk_ordnance_survey_names.rb +59 -0
- data/lib/geocoder/results/yandex.rb +244 -32
- data/lib/geocoder/sql.rb +25 -21
- data/lib/geocoder/stores/active_record.rb +82 -26
- data/lib/geocoder/stores/base.rb +9 -14
- data/lib/geocoder/stores/mongo_base.rb +0 -31
- data/lib/geocoder/util.rb +29 -0
- data/lib/geocoder/version.rb +1 -1
- data/lib/geocoder.rb +6 -13
- data/lib/maxmind_database.rb +109 -0
- data/lib/tasks/geocoder.rake +30 -3
- data/lib/tasks/maxmind.rake +73 -0
- metadata +115 -98
- data/.gitignore +0 -5
- data/.travis.yml +0 -27
- data/Rakefile +0 -25
- data/examples/autoexpire_cache_dalli.rb +0 -62
- data/examples/autoexpire_cache_redis.rb +0 -28
- data/gemfiles/Gemfile.mongoid-2.4.x +0 -15
- data/lib/geocoder/lookups/geocoder_us.rb +0 -39
- data/lib/geocoder/lookups/ovi.rb +0 -62
- data/lib/geocoder/lookups/yahoo.rb +0 -86
- data/lib/geocoder/results/geocoder_us.rb +0 -39
- data/lib/geocoder/results/ovi.rb +0 -62
- data/lib/geocoder/results/yahoo.rb +0 -55
- data/lib/hash_recursive_merge.rb +0 -74
- data/lib/oauth_util.rb +0 -112
- data/test/active_record_test.rb +0 -15
- data/test/cache_test.rb +0 -35
- data/test/calculations_test.rb +0 -211
- data/test/configuration_test.rb +0 -78
- data/test/custom_block_test.rb +0 -32
- data/test/error_handling_test.rb +0 -43
- data/test/fixtures/baidu_invalid_key +0 -1
- data/test/fixtures/baidu_no_results +0 -1
- data/test/fixtures/baidu_reverse +0 -1
- data/test/fixtures/baidu_shanghai_pearl_tower +0 -12
- data/test/fixtures/bing_invalid_key +0 -1
- data/test/fixtures/bing_madison_square_garden +0 -40
- data/test/fixtures/bing_no_results +0 -16
- data/test/fixtures/bing_reverse +0 -42
- data/test/fixtures/esri_madison_square_garden +0 -59
- data/test/fixtures/esri_no_results +0 -8
- data/test/fixtures/esri_reverse +0 -21
- data/test/fixtures/freegeoip_74_200_247_59 +0 -12
- data/test/fixtures/freegeoip_no_results +0 -1
- data/test/fixtures/geocoder_ca_madison_square_garden +0 -1
- data/test/fixtures/geocoder_ca_no_results +0 -1
- data/test/fixtures/geocoder_ca_reverse +0 -34
- data/test/fixtures/geocoder_us_madison_square_garden +0 -1
- data/test/fixtures/geocoder_us_no_results +0 -1
- data/test/fixtures/google_garbage +0 -456
- data/test/fixtures/google_madison_square_garden +0 -57
- data/test/fixtures/google_no_city_data +0 -44
- data/test/fixtures/google_no_locality +0 -51
- data/test/fixtures/google_no_results +0 -4
- data/test/fixtures/google_over_limit +0 -4
- data/test/fixtures/mapquest_error +0 -16
- data/test/fixtures/mapquest_invalid_api_key +0 -16
- data/test/fixtures/mapquest_invalid_request +0 -16
- data/test/fixtures/mapquest_madison_square_garden +0 -52
- data/test/fixtures/mapquest_no_results +0 -16
- data/test/fixtures/maxmind_24_24_24_21 +0 -1
- data/test/fixtures/maxmind_24_24_24_22 +0 -1
- data/test/fixtures/maxmind_24_24_24_23 +0 -1
- data/test/fixtures/maxmind_24_24_24_24 +0 -1
- data/test/fixtures/maxmind_74_200_247_59 +0 -1
- data/test/fixtures/maxmind_invalid_key +0 -1
- data/test/fixtures/maxmind_no_results +0 -1
- data/test/fixtures/nominatim_madison_square_garden +0 -150
- data/test/fixtures/nominatim_no_results +0 -1
- data/test/fixtures/ovi_madison_square_garden +0 -72
- data/test/fixtures/ovi_no_results +0 -8
- data/test/fixtures/yahoo_error +0 -1
- data/test/fixtures/yahoo_invalid_key +0 -2
- data/test/fixtures/yahoo_madison_square_garden +0 -52
- data/test/fixtures/yahoo_no_results +0 -10
- data/test/fixtures/yahoo_over_limit +0 -2
- data/test/fixtures/yandex_invalid_key +0 -1
- data/test/fixtures/yandex_kremlin +0 -48
- data/test/fixtures/yandex_no_city_and_town +0 -112
- data/test/fixtures/yandex_no_results +0 -16
- data/test/geocoder_test.rb +0 -59
- data/test/https_test.rb +0 -16
- data/test/integration/smoke_test.rb +0 -26
- data/test/lookup_test.rb +0 -117
- data/test/method_aliases_test.rb +0 -25
- data/test/mongoid_test.rb +0 -46
- data/test/mongoid_test_helper.rb +0 -43
- data/test/near_test.rb +0 -61
- data/test/oauth_util_test.rb +0 -30
- data/test/proxy_test.rb +0 -36
- data/test/query_test.rb +0 -52
- data/test/request_test.rb +0 -29
- data/test/result_test.rb +0 -42
- data/test/services_test.rb +0 -393
- data/test/test_helper.rb +0 -289
- data/test/test_mode_test.rb +0 -59
|
@@ -11,37 +11,6 @@ module Geocoder::Store
|
|
|
11
11
|
scope :not_geocoded, lambda {
|
|
12
12
|
where(geocoder_options[:coordinates] => nil)
|
|
13
13
|
}
|
|
14
|
-
|
|
15
|
-
scope :near, lambda{ |location, *args|
|
|
16
|
-
coords = Geocoder::Calculations.extract_coordinates(location)
|
|
17
|
-
|
|
18
|
-
# no results if no lat/lon given
|
|
19
|
-
return where(:id => false) unless coords.is_a?(Array)
|
|
20
|
-
|
|
21
|
-
radius = args.size > 0 ? args.shift : 20
|
|
22
|
-
options = args.size > 0 ? args.shift : {}
|
|
23
|
-
options[:units] ||= geocoder_options[:units]
|
|
24
|
-
|
|
25
|
-
# Use BSON::OrderedHash if Ruby's hashes are unordered.
|
|
26
|
-
# Conditions must be in order required by indexes (see mongo gem).
|
|
27
|
-
version = RUBY_VERSION.split('.').map { |i| i.to_i }
|
|
28
|
-
empty = version[0] < 2 && version[1] < 9 ? BSON::OrderedHash.new : {}
|
|
29
|
-
|
|
30
|
-
conds = empty.clone
|
|
31
|
-
field = geocoder_options[:coordinates]
|
|
32
|
-
conds[field] = empty.clone
|
|
33
|
-
conds[field]["$nearSphere"] = coords.reverse
|
|
34
|
-
|
|
35
|
-
if radius
|
|
36
|
-
conds[field]["$maxDistance"] = \
|
|
37
|
-
Geocoder::Calculations.distance_to_radians(radius, options[:units])
|
|
38
|
-
end
|
|
39
|
-
|
|
40
|
-
if obj = options[:exclude]
|
|
41
|
-
conds[:_id.ne] = obj.id
|
|
42
|
-
end
|
|
43
|
-
where(conds)
|
|
44
|
-
}
|
|
45
14
|
end
|
|
46
15
|
end
|
|
47
16
|
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Geocoder
|
|
4
|
+
module Util
|
|
5
|
+
#
|
|
6
|
+
# Recursive version of Hash#merge!
|
|
7
|
+
#
|
|
8
|
+
# Adds the contents of +h2+ to +h1+,
|
|
9
|
+
# merging entries in +h1+ with duplicate keys with those from +h2+.
|
|
10
|
+
#
|
|
11
|
+
# Compared with Hash#merge!, this method supports nested hashes.
|
|
12
|
+
# When both +h1+ and +h2+ contains an entry with the same key,
|
|
13
|
+
# it merges and returns the values from both hashes.
|
|
14
|
+
#
|
|
15
|
+
# h1 = {"a" => 100, "b" => 200, "c" => {"c1" => 12, "c2" => 14}}
|
|
16
|
+
# h2 = {"b" => 254, "c" => {"c1" => 16, "c3" => 94}}
|
|
17
|
+
# recursive_hash_merge(h1, h2) #=> {"a" => 100, "b" => 254, "c" => {"c1" => 16, "c2" => 14, "c3" => 94}}
|
|
18
|
+
#
|
|
19
|
+
# Simply using Hash#merge! would return
|
|
20
|
+
#
|
|
21
|
+
# h1.merge!(h2) #=> {"a" => 100, "b" = >254, "c" => {"c1" => 16, "c3" => 94}}
|
|
22
|
+
#
|
|
23
|
+
def self.recursive_hash_merge(h1, h2)
|
|
24
|
+
h1.merge!(h2) do |_key, oldval, newval|
|
|
25
|
+
oldval.class == h1.class ? self.recursive_hash_merge(oldval, newval) : newval
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
data/lib/geocoder/version.rb
CHANGED
data/lib/geocoder.rb
CHANGED
|
@@ -1,21 +1,23 @@
|
|
|
1
1
|
require "geocoder/configuration"
|
|
2
|
+
require "geocoder/logger"
|
|
3
|
+
require "geocoder/kernel_logger"
|
|
2
4
|
require "geocoder/query"
|
|
3
5
|
require "geocoder/calculations"
|
|
4
6
|
require "geocoder/exceptions"
|
|
5
7
|
require "geocoder/cache"
|
|
6
8
|
require "geocoder/request"
|
|
7
9
|
require "geocoder/lookup"
|
|
10
|
+
require "geocoder/ip_address"
|
|
8
11
|
require "geocoder/models/active_record" if defined?(::ActiveRecord)
|
|
9
12
|
require "geocoder/models/mongoid" if defined?(::Mongoid)
|
|
10
13
|
require "geocoder/models/mongo_mapper" if defined?(::MongoMapper)
|
|
11
14
|
|
|
12
15
|
module Geocoder
|
|
13
|
-
extend self
|
|
14
16
|
|
|
15
17
|
##
|
|
16
18
|
# Search for information about an address or a set of coordinates.
|
|
17
19
|
#
|
|
18
|
-
def search(query, options = {})
|
|
20
|
+
def self.search(query, options = {})
|
|
19
21
|
query = Geocoder::Query.new(query, options) unless query.is_a?(Geocoder::Query)
|
|
20
22
|
query.blank? ? [] : query.execute
|
|
21
23
|
end
|
|
@@ -23,7 +25,7 @@ module Geocoder
|
|
|
23
25
|
##
|
|
24
26
|
# Look up the coordinates of the given street or IP address.
|
|
25
27
|
#
|
|
26
|
-
def coordinates(address, options = {})
|
|
28
|
+
def self.coordinates(address, options = {})
|
|
27
29
|
if (results = search(address, options)).size > 0
|
|
28
30
|
results.first.coordinates
|
|
29
31
|
end
|
|
@@ -33,23 +35,14 @@ module Geocoder
|
|
|
33
35
|
# Look up the address of the given coordinates ([lat,lon])
|
|
34
36
|
# or IP address (string).
|
|
35
37
|
#
|
|
36
|
-
def address(query, options = {})
|
|
38
|
+
def self.address(query, options = {})
|
|
37
39
|
if (results = search(query, options)).size > 0
|
|
38
40
|
results.first.address
|
|
39
41
|
end
|
|
40
42
|
end
|
|
41
|
-
|
|
42
|
-
##
|
|
43
|
-
# The working Cache object, or +nil+ if none configured.
|
|
44
|
-
#
|
|
45
|
-
def cache
|
|
46
|
-
warn "WARNING: Calling Geocoder.cache is DEPRECATED. The #cache method now belongs to the Geocoder::Lookup object."
|
|
47
|
-
Geocoder::Lookup.get(Geocoder.config.lookup).cache
|
|
48
|
-
end
|
|
49
43
|
end
|
|
50
44
|
|
|
51
45
|
# load Railtie if Rails exists
|
|
52
46
|
if defined?(Rails)
|
|
53
47
|
require "geocoder/railtie"
|
|
54
|
-
Geocoder::Railtie.insert
|
|
55
48
|
end
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
require 'csv'
|
|
2
|
+
require 'net/http'
|
|
3
|
+
|
|
4
|
+
module Geocoder
|
|
5
|
+
module MaxmindDatabase
|
|
6
|
+
extend self
|
|
7
|
+
|
|
8
|
+
def download(package, dir = "tmp")
|
|
9
|
+
filepath = File.expand_path(File.join(dir, archive_filename(package)))
|
|
10
|
+
open(filepath, 'wb') do |file|
|
|
11
|
+
uri = URI.parse(archive_url(package))
|
|
12
|
+
Net::HTTP.start(uri.host, uri.port) do |http|
|
|
13
|
+
http.request_get(uri.path) do |resp|
|
|
14
|
+
# TODO: show progress
|
|
15
|
+
resp.read_body do |segment|
|
|
16
|
+
file.write(segment)
|
|
17
|
+
end
|
|
18
|
+
end
|
|
19
|
+
end
|
|
20
|
+
end
|
|
21
|
+
end
|
|
22
|
+
|
|
23
|
+
def insert(package, dir = "tmp")
|
|
24
|
+
data_files(package, dir).each do |filepath,table|
|
|
25
|
+
print "Resetting table #{table}..."
|
|
26
|
+
ActiveRecord::Base.connection.execute("DELETE FROM #{table}")
|
|
27
|
+
puts "done"
|
|
28
|
+
insert_into_table(table, filepath)
|
|
29
|
+
end
|
|
30
|
+
end
|
|
31
|
+
|
|
32
|
+
def archive_filename(package)
|
|
33
|
+
p = archive_url_path(package)
|
|
34
|
+
s = !(pos = p.rindex('/')).nil? && pos + 1 || 0
|
|
35
|
+
p[s..-1]
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
private # -------------------------------------------------------------
|
|
39
|
+
|
|
40
|
+
def table_columns(table_name)
|
|
41
|
+
{
|
|
42
|
+
maxmind_geolite_city_blocks: %w[start_ip_num end_ip_num loc_id],
|
|
43
|
+
maxmind_geolite_city_location: %w[loc_id country region city postal_code latitude longitude metro_code area_code],
|
|
44
|
+
maxmind_geolite_country: %w[start_ip end_ip start_ip_num end_ip_num country_code country]
|
|
45
|
+
}[table_name.to_sym]
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def insert_into_table(table, filepath)
|
|
49
|
+
start_time = Time.now
|
|
50
|
+
print "Loading data for table #{table}"
|
|
51
|
+
rows = []
|
|
52
|
+
columns = table_columns(table)
|
|
53
|
+
CSV.foreach(filepath, encoding: "ISO-8859-1") do |line|
|
|
54
|
+
# Some files have header rows.
|
|
55
|
+
# skip if starts with "Copyright" or "locId" or "startIpNum"
|
|
56
|
+
next if line.first.match(/[A-z]/)
|
|
57
|
+
rows << line.to_a
|
|
58
|
+
if rows.size == 10000
|
|
59
|
+
insert_rows(table, columns, rows)
|
|
60
|
+
rows = []
|
|
61
|
+
print "."
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
insert_rows(table, columns, rows) if rows.size > 0
|
|
65
|
+
puts "done (#{Time.now - start_time} seconds)"
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def insert_rows(table, headers, rows)
|
|
69
|
+
value_strings = rows.map do |row|
|
|
70
|
+
"(" + row.map{ |col| sql_escaped_value(col) }.join(',') + ")"
|
|
71
|
+
end
|
|
72
|
+
q = "INSERT INTO #{table} (#{headers.join(',')}) " +
|
|
73
|
+
"VALUES #{value_strings.join(',')}"
|
|
74
|
+
ActiveRecord::Base.connection.execute(q)
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
def sql_escaped_value(value)
|
|
78
|
+
value.to_i.to_s == value ? value :
|
|
79
|
+
ActiveRecord::Base.connection.quote(value)
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def data_files(package, dir = "tmp")
|
|
83
|
+
case package
|
|
84
|
+
when :geolite_city_csv
|
|
85
|
+
# use the last two in case multiple versions exist
|
|
86
|
+
files = Dir.glob(File.join(dir, "GeoLiteCity_*/*.csv"))[-2..-1].sort
|
|
87
|
+
Hash[*files.zip(["maxmind_geolite_city_blocks", "maxmind_geolite_city_location"]).flatten]
|
|
88
|
+
when :geolite_country_csv
|
|
89
|
+
{File.join(dir, "GeoIPCountryWhois.csv") => "maxmind_geolite_country"}
|
|
90
|
+
end
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
def archive_url(package)
|
|
94
|
+
base_url + archive_url_path(package)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
def archive_url_path(package)
|
|
98
|
+
{
|
|
99
|
+
geolite_country_csv: "GeoLite2-Country-CSV.zip",
|
|
100
|
+
geolite_city_csv: "GeoLite2-City-CSV.zip",
|
|
101
|
+
geolite_asn_csv: "GeoLite2-ASN-CSV.zip"
|
|
102
|
+
}[package]
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
def base_url
|
|
106
|
+
"http://geolite.maxmind.com/download/geoip/database/"
|
|
107
|
+
end
|
|
108
|
+
end
|
|
109
|
+
end
|
data/lib/tasks/geocoder.rake
CHANGED
|
@@ -1,18 +1,45 @@
|
|
|
1
|
+
require "geocoder/models/mongoid"
|
|
2
|
+
|
|
1
3
|
namespace :geocode do
|
|
2
4
|
desc "Geocode all objects without coordinates."
|
|
3
5
|
task :all => :environment do
|
|
4
6
|
class_name = ENV['CLASS'] || ENV['class']
|
|
5
7
|
sleep_timer = ENV['SLEEP'] || ENV['sleep']
|
|
8
|
+
batch = ENV['BATCH'] || ENV['batch']
|
|
9
|
+
reverse = ENV['REVERSE'] || ENV['reverse']
|
|
10
|
+
limit = ENV['LIMIT'] || ENV['limit']
|
|
6
11
|
raise "Please specify a CLASS (model)" unless class_name
|
|
7
12
|
klass = class_from_string(class_name)
|
|
13
|
+
batch = (batch.to_i unless batch.nil?) || 1000
|
|
14
|
+
orm = (klass < Geocoder::Model::Mongoid) ? 'mongoid' : 'active_record'
|
|
15
|
+
reverse = false unless reverse.to_s.downcase == 'true'
|
|
8
16
|
|
|
9
|
-
|
|
10
|
-
obj.
|
|
17
|
+
geocode_record = lambda { |obj|
|
|
18
|
+
reverse ? obj.reverse_geocode : obj.geocode
|
|
19
|
+
obj.save
|
|
11
20
|
sleep(sleep_timer.to_f) unless sleep_timer.nil?
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
scope = reverse ? klass.not_reverse_geocoded : klass.not_geocoded
|
|
24
|
+
scope = scope.limit(limit) if limit
|
|
25
|
+
if orm == 'mongoid'
|
|
26
|
+
scope.each do |obj|
|
|
27
|
+
geocode_record.call(obj)
|
|
28
|
+
end
|
|
29
|
+
elsif orm == 'active_record'
|
|
30
|
+
if limit
|
|
31
|
+
scope.each do |obj|
|
|
32
|
+
geocode_record.call(obj)
|
|
33
|
+
end
|
|
34
|
+
else
|
|
35
|
+
scope.find_each(batch_size: batch) do |obj|
|
|
36
|
+
geocode_record.call(obj)
|
|
37
|
+
end
|
|
38
|
+
end
|
|
12
39
|
end
|
|
40
|
+
|
|
13
41
|
end
|
|
14
42
|
end
|
|
15
|
-
|
|
16
43
|
##
|
|
17
44
|
# Get a class object from the string given in the shell environment.
|
|
18
45
|
# Similar to ActiveSupport's +constantize+ method.
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
require 'maxmind_database'
|
|
2
|
+
|
|
3
|
+
namespace :geocoder do
|
|
4
|
+
namespace :maxmind do
|
|
5
|
+
namespace :geolite do
|
|
6
|
+
|
|
7
|
+
desc "Download and load/refresh MaxMind GeoLite City data"
|
|
8
|
+
task load: [:download, :extract, :insert]
|
|
9
|
+
|
|
10
|
+
desc "Download MaxMind GeoLite City data"
|
|
11
|
+
task :download do
|
|
12
|
+
p = MaxmindTask.check_for_package!
|
|
13
|
+
MaxmindTask.download!(p, dir: ENV['DIR'] || "tmp/")
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
desc "Extract (unzip) MaxMind GeoLite City data"
|
|
17
|
+
task :extract do
|
|
18
|
+
p = MaxmindTask.check_for_package!
|
|
19
|
+
MaxmindTask.extract!(p, dir: ENV['DIR'] || "tmp/")
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
desc "Load/refresh MaxMind GeoLite City data"
|
|
23
|
+
task insert: [:environment] do
|
|
24
|
+
p = MaxmindTask.check_for_package!
|
|
25
|
+
MaxmindTask.insert!(p, dir: ENV['DIR'] || "tmp/")
|
|
26
|
+
end
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
module MaxmindTask
|
|
32
|
+
extend self
|
|
33
|
+
|
|
34
|
+
def check_for_package!
|
|
35
|
+
if %w[city country].include?(p = ENV['PACKAGE'])
|
|
36
|
+
return p
|
|
37
|
+
else
|
|
38
|
+
puts "Please specify PACKAGE=city or PACKAGE=country"
|
|
39
|
+
exit
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def download!(package, options = {})
|
|
44
|
+
p = "geolite_#{package}_csv".intern
|
|
45
|
+
Geocoder::MaxmindDatabase.download(p, options[:dir])
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
def extract!(package, options = {})
|
|
49
|
+
begin
|
|
50
|
+
require 'zip'
|
|
51
|
+
rescue LoadError
|
|
52
|
+
puts "Please install gem: rubyzip (>= 1.0.0)"
|
|
53
|
+
exit
|
|
54
|
+
end
|
|
55
|
+
require 'fileutils'
|
|
56
|
+
p = "geolite_#{package}_csv".intern
|
|
57
|
+
archive_filename = Geocoder::MaxmindDatabase.archive_filename(p)
|
|
58
|
+
Zip::File.open(File.join(options[:dir], archive_filename)).each do |entry|
|
|
59
|
+
filepath = File.join(options[:dir], entry.name)
|
|
60
|
+
if File.exist? filepath
|
|
61
|
+
warn "File already exists (#{entry.name}), skipping"
|
|
62
|
+
else
|
|
63
|
+
FileUtils.mkdir_p(File.dirname(filepath))
|
|
64
|
+
entry.extract(filepath)
|
|
65
|
+
end
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def insert!(package, options = {})
|
|
70
|
+
p = "geolite_#{package}_csv".intern
|
|
71
|
+
Geocoder::MaxmindDatabase.insert(p, options[:dir])
|
|
72
|
+
end
|
|
73
|
+
end
|
metadata
CHANGED
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: geocoder
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.
|
|
4
|
+
version: 1.8.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Alex Reisner
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date:
|
|
11
|
+
date: 2022-05-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies: []
|
|
13
|
-
description:
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
frameworks too.
|
|
13
|
+
description: Object geocoding (by street or IP address), reverse geocoding (coordinates
|
|
14
|
+
to street address), distance queries for ActiveRecord and Mongoid, result caching,
|
|
15
|
+
and more. Designed for Rails but works with Sinatra and other Rack frameworks too.
|
|
17
16
|
email:
|
|
18
17
|
- alex@alexreisner.com
|
|
19
18
|
executables:
|
|
@@ -21,43 +20,91 @@ executables:
|
|
|
21
20
|
extensions: []
|
|
22
21
|
extra_rdoc_files: []
|
|
23
22
|
files:
|
|
24
|
-
- .gitignore
|
|
25
|
-
- .travis.yml
|
|
26
23
|
- CHANGELOG.md
|
|
27
24
|
- LICENSE
|
|
28
25
|
- README.md
|
|
29
|
-
-
|
|
26
|
+
- bin/console
|
|
30
27
|
- bin/geocode
|
|
31
|
-
- examples/
|
|
32
|
-
- examples/autoexpire_cache_redis.rb
|
|
28
|
+
- examples/app_defined_lookup_services.rb
|
|
33
29
|
- examples/cache_bypass.rb
|
|
34
|
-
-
|
|
30
|
+
- examples/reverse_geocode_job.rb
|
|
31
|
+
- lib/easting_northing.rb
|
|
35
32
|
- lib/generators/geocoder/config/config_generator.rb
|
|
36
33
|
- lib/generators/geocoder/config/templates/initializer.rb
|
|
34
|
+
- lib/generators/geocoder/maxmind/geolite_city_generator.rb
|
|
35
|
+
- lib/generators/geocoder/maxmind/geolite_country_generator.rb
|
|
36
|
+
- lib/generators/geocoder/maxmind/templates/migration/geolite_city.rb
|
|
37
|
+
- lib/generators/geocoder/maxmind/templates/migration/geolite_country.rb
|
|
38
|
+
- lib/generators/geocoder/migration_version.rb
|
|
37
39
|
- lib/geocoder.rb
|
|
38
40
|
- lib/geocoder/cache.rb
|
|
41
|
+
- lib/geocoder/cache_stores/base.rb
|
|
42
|
+
- lib/geocoder/cache_stores/generic.rb
|
|
43
|
+
- lib/geocoder/cache_stores/redis.rb
|
|
39
44
|
- lib/geocoder/calculations.rb
|
|
40
45
|
- lib/geocoder/cli.rb
|
|
41
46
|
- lib/geocoder/configuration.rb
|
|
42
47
|
- lib/geocoder/configuration_hash.rb
|
|
48
|
+
- lib/geocoder/esri_token.rb
|
|
43
49
|
- lib/geocoder/exceptions.rb
|
|
50
|
+
- lib/geocoder/ip_address.rb
|
|
51
|
+
- lib/geocoder/kernel_logger.rb
|
|
52
|
+
- lib/geocoder/logger.rb
|
|
44
53
|
- lib/geocoder/lookup.rb
|
|
54
|
+
- lib/geocoder/lookups/abstract_api.rb
|
|
55
|
+
- lib/geocoder/lookups/amap.rb
|
|
56
|
+
- lib/geocoder/lookups/amazon_location_service.rb
|
|
45
57
|
- lib/geocoder/lookups/baidu.rb
|
|
58
|
+
- lib/geocoder/lookups/baidu_ip.rb
|
|
59
|
+
- lib/geocoder/lookups/ban_data_gouv_fr.rb
|
|
46
60
|
- lib/geocoder/lookups/base.rb
|
|
47
61
|
- lib/geocoder/lookups/bing.rb
|
|
62
|
+
- lib/geocoder/lookups/db_ip_com.rb
|
|
48
63
|
- lib/geocoder/lookups/dstk.rb
|
|
49
64
|
- lib/geocoder/lookups/esri.rb
|
|
50
65
|
- lib/geocoder/lookups/freegeoip.rb
|
|
66
|
+
- lib/geocoder/lookups/geoapify.rb
|
|
51
67
|
- lib/geocoder/lookups/geocoder_ca.rb
|
|
52
|
-
- lib/geocoder/lookups/
|
|
68
|
+
- lib/geocoder/lookups/geocodio.rb
|
|
69
|
+
- lib/geocoder/lookups/geoip2.rb
|
|
70
|
+
- lib/geocoder/lookups/geoportail_lu.rb
|
|
53
71
|
- lib/geocoder/lookups/google.rb
|
|
72
|
+
- lib/geocoder/lookups/google_places_details.rb
|
|
73
|
+
- lib/geocoder/lookups/google_places_search.rb
|
|
54
74
|
- lib/geocoder/lookups/google_premier.rb
|
|
75
|
+
- lib/geocoder/lookups/here.rb
|
|
76
|
+
- lib/geocoder/lookups/ip2location.rb
|
|
77
|
+
- lib/geocoder/lookups/ipapi_com.rb
|
|
78
|
+
- lib/geocoder/lookups/ipdata_co.rb
|
|
79
|
+
- lib/geocoder/lookups/ipgeolocation.rb
|
|
80
|
+
- lib/geocoder/lookups/ipinfo_io.rb
|
|
81
|
+
- lib/geocoder/lookups/ipqualityscore.rb
|
|
82
|
+
- lib/geocoder/lookups/ipregistry.rb
|
|
83
|
+
- lib/geocoder/lookups/ipstack.rb
|
|
84
|
+
- lib/geocoder/lookups/latlon.rb
|
|
85
|
+
- lib/geocoder/lookups/location_iq.rb
|
|
86
|
+
- lib/geocoder/lookups/mapbox.rb
|
|
55
87
|
- lib/geocoder/lookups/mapquest.rb
|
|
56
88
|
- lib/geocoder/lookups/maxmind.rb
|
|
89
|
+
- lib/geocoder/lookups/maxmind_geoip2.rb
|
|
90
|
+
- lib/geocoder/lookups/maxmind_local.rb
|
|
91
|
+
- lib/geocoder/lookups/melissa_street.rb
|
|
92
|
+
- lib/geocoder/lookups/nationaal_georegister_nl.rb
|
|
57
93
|
- lib/geocoder/lookups/nominatim.rb
|
|
58
|
-
- lib/geocoder/lookups/
|
|
94
|
+
- lib/geocoder/lookups/opencagedata.rb
|
|
95
|
+
- lib/geocoder/lookups/osmnames.rb
|
|
96
|
+
- lib/geocoder/lookups/pelias.rb
|
|
97
|
+
- lib/geocoder/lookups/photon.rb
|
|
98
|
+
- lib/geocoder/lookups/pickpoint.rb
|
|
99
|
+
- lib/geocoder/lookups/pointpin.rb
|
|
100
|
+
- lib/geocoder/lookups/postcode_anywhere_uk.rb
|
|
101
|
+
- lib/geocoder/lookups/postcodes_io.rb
|
|
102
|
+
- lib/geocoder/lookups/smarty_streets.rb
|
|
103
|
+
- lib/geocoder/lookups/telize.rb
|
|
104
|
+
- lib/geocoder/lookups/tencent.rb
|
|
59
105
|
- lib/geocoder/lookups/test.rb
|
|
60
|
-
- lib/geocoder/lookups/
|
|
106
|
+
- lib/geocoder/lookups/twogis.rb
|
|
107
|
+
- lib/geocoder/lookups/uk_ordnance_survey_names.rb
|
|
61
108
|
- lib/geocoder/lookups/yandex.rb
|
|
62
109
|
- lib/geocoder/models/active_record.rb
|
|
63
110
|
- lib/geocoder/models/base.rb
|
|
@@ -67,22 +114,60 @@ files:
|
|
|
67
114
|
- lib/geocoder/query.rb
|
|
68
115
|
- lib/geocoder/railtie.rb
|
|
69
116
|
- lib/geocoder/request.rb
|
|
117
|
+
- lib/geocoder/results/abstract_api.rb
|
|
118
|
+
- lib/geocoder/results/amap.rb
|
|
119
|
+
- lib/geocoder/results/amazon_location_service.rb
|
|
70
120
|
- lib/geocoder/results/baidu.rb
|
|
121
|
+
- lib/geocoder/results/baidu_ip.rb
|
|
122
|
+
- lib/geocoder/results/ban_data_gouv_fr.rb
|
|
71
123
|
- lib/geocoder/results/base.rb
|
|
72
124
|
- lib/geocoder/results/bing.rb
|
|
125
|
+
- lib/geocoder/results/db_ip_com.rb
|
|
73
126
|
- lib/geocoder/results/dstk.rb
|
|
74
127
|
- lib/geocoder/results/esri.rb
|
|
75
128
|
- lib/geocoder/results/freegeoip.rb
|
|
129
|
+
- lib/geocoder/results/geoapify.rb
|
|
76
130
|
- lib/geocoder/results/geocoder_ca.rb
|
|
77
|
-
- lib/geocoder/results/
|
|
131
|
+
- lib/geocoder/results/geocodio.rb
|
|
132
|
+
- lib/geocoder/results/geoip2.rb
|
|
133
|
+
- lib/geocoder/results/geoportail_lu.rb
|
|
78
134
|
- lib/geocoder/results/google.rb
|
|
135
|
+
- lib/geocoder/results/google_places_details.rb
|
|
136
|
+
- lib/geocoder/results/google_places_search.rb
|
|
79
137
|
- lib/geocoder/results/google_premier.rb
|
|
138
|
+
- lib/geocoder/results/here.rb
|
|
139
|
+
- lib/geocoder/results/ip2location.rb
|
|
140
|
+
- lib/geocoder/results/ipapi_com.rb
|
|
141
|
+
- lib/geocoder/results/ipdata_co.rb
|
|
142
|
+
- lib/geocoder/results/ipgeolocation.rb
|
|
143
|
+
- lib/geocoder/results/ipinfo_io.rb
|
|
144
|
+
- lib/geocoder/results/ipqualityscore.rb
|
|
145
|
+
- lib/geocoder/results/ipregistry.rb
|
|
146
|
+
- lib/geocoder/results/ipstack.rb
|
|
147
|
+
- lib/geocoder/results/latlon.rb
|
|
148
|
+
- lib/geocoder/results/location_iq.rb
|
|
149
|
+
- lib/geocoder/results/mapbox.rb
|
|
80
150
|
- lib/geocoder/results/mapquest.rb
|
|
81
151
|
- lib/geocoder/results/maxmind.rb
|
|
152
|
+
- lib/geocoder/results/maxmind_geoip2.rb
|
|
153
|
+
- lib/geocoder/results/maxmind_local.rb
|
|
154
|
+
- lib/geocoder/results/melissa_street.rb
|
|
155
|
+
- lib/geocoder/results/nationaal_georegister_nl.rb
|
|
82
156
|
- lib/geocoder/results/nominatim.rb
|
|
83
|
-
- lib/geocoder/results/
|
|
157
|
+
- lib/geocoder/results/opencagedata.rb
|
|
158
|
+
- lib/geocoder/results/osmnames.rb
|
|
159
|
+
- lib/geocoder/results/pelias.rb
|
|
160
|
+
- lib/geocoder/results/photon.rb
|
|
161
|
+
- lib/geocoder/results/pickpoint.rb
|
|
162
|
+
- lib/geocoder/results/pointpin.rb
|
|
163
|
+
- lib/geocoder/results/postcode_anywhere_uk.rb
|
|
164
|
+
- lib/geocoder/results/postcodes_io.rb
|
|
165
|
+
- lib/geocoder/results/smarty_streets.rb
|
|
166
|
+
- lib/geocoder/results/telize.rb
|
|
167
|
+
- lib/geocoder/results/tencent.rb
|
|
84
168
|
- lib/geocoder/results/test.rb
|
|
85
|
-
- lib/geocoder/results/
|
|
169
|
+
- lib/geocoder/results/twogis.rb
|
|
170
|
+
- lib/geocoder/results/uk_ordnance_survey_names.rb
|
|
86
171
|
- lib/geocoder/results/yandex.rb
|
|
87
172
|
- lib/geocoder/sql.rb
|
|
88
173
|
- lib/geocoder/stores/active_record.rb
|
|
@@ -90,101 +175,33 @@ files:
|
|
|
90
175
|
- lib/geocoder/stores/mongo_base.rb
|
|
91
176
|
- lib/geocoder/stores/mongo_mapper.rb
|
|
92
177
|
- lib/geocoder/stores/mongoid.rb
|
|
178
|
+
- lib/geocoder/util.rb
|
|
93
179
|
- lib/geocoder/version.rb
|
|
94
|
-
- lib/
|
|
95
|
-
- lib/oauth_util.rb
|
|
180
|
+
- lib/maxmind_database.rb
|
|
96
181
|
- lib/tasks/geocoder.rake
|
|
97
|
-
-
|
|
98
|
-
- test/cache_test.rb
|
|
99
|
-
- test/calculations_test.rb
|
|
100
|
-
- test/configuration_test.rb
|
|
101
|
-
- test/custom_block_test.rb
|
|
102
|
-
- test/error_handling_test.rb
|
|
103
|
-
- test/fixtures/baidu_invalid_key
|
|
104
|
-
- test/fixtures/baidu_no_results
|
|
105
|
-
- test/fixtures/baidu_reverse
|
|
106
|
-
- test/fixtures/baidu_shanghai_pearl_tower
|
|
107
|
-
- test/fixtures/bing_invalid_key
|
|
108
|
-
- test/fixtures/bing_madison_square_garden
|
|
109
|
-
- test/fixtures/bing_no_results
|
|
110
|
-
- test/fixtures/bing_reverse
|
|
111
|
-
- test/fixtures/esri_madison_square_garden
|
|
112
|
-
- test/fixtures/esri_no_results
|
|
113
|
-
- test/fixtures/esri_reverse
|
|
114
|
-
- test/fixtures/freegeoip_74_200_247_59
|
|
115
|
-
- test/fixtures/freegeoip_no_results
|
|
116
|
-
- test/fixtures/geocoder_ca_madison_square_garden
|
|
117
|
-
- test/fixtures/geocoder_ca_no_results
|
|
118
|
-
- test/fixtures/geocoder_ca_reverse
|
|
119
|
-
- test/fixtures/geocoder_us_madison_square_garden
|
|
120
|
-
- test/fixtures/geocoder_us_no_results
|
|
121
|
-
- test/fixtures/google_garbage
|
|
122
|
-
- test/fixtures/google_madison_square_garden
|
|
123
|
-
- test/fixtures/google_no_city_data
|
|
124
|
-
- test/fixtures/google_no_locality
|
|
125
|
-
- test/fixtures/google_no_results
|
|
126
|
-
- test/fixtures/google_over_limit
|
|
127
|
-
- test/fixtures/mapquest_error
|
|
128
|
-
- test/fixtures/mapquest_invalid_api_key
|
|
129
|
-
- test/fixtures/mapquest_invalid_request
|
|
130
|
-
- test/fixtures/mapquest_madison_square_garden
|
|
131
|
-
- test/fixtures/mapquest_no_results
|
|
132
|
-
- test/fixtures/maxmind_24_24_24_21
|
|
133
|
-
- test/fixtures/maxmind_24_24_24_22
|
|
134
|
-
- test/fixtures/maxmind_24_24_24_23
|
|
135
|
-
- test/fixtures/maxmind_24_24_24_24
|
|
136
|
-
- test/fixtures/maxmind_74_200_247_59
|
|
137
|
-
- test/fixtures/maxmind_invalid_key
|
|
138
|
-
- test/fixtures/maxmind_no_results
|
|
139
|
-
- test/fixtures/nominatim_madison_square_garden
|
|
140
|
-
- test/fixtures/nominatim_no_results
|
|
141
|
-
- test/fixtures/ovi_madison_square_garden
|
|
142
|
-
- test/fixtures/ovi_no_results
|
|
143
|
-
- test/fixtures/yahoo_error
|
|
144
|
-
- test/fixtures/yahoo_invalid_key
|
|
145
|
-
- test/fixtures/yahoo_madison_square_garden
|
|
146
|
-
- test/fixtures/yahoo_no_results
|
|
147
|
-
- test/fixtures/yahoo_over_limit
|
|
148
|
-
- test/fixtures/yandex_invalid_key
|
|
149
|
-
- test/fixtures/yandex_kremlin
|
|
150
|
-
- test/fixtures/yandex_no_city_and_town
|
|
151
|
-
- test/fixtures/yandex_no_results
|
|
152
|
-
- test/geocoder_test.rb
|
|
153
|
-
- test/https_test.rb
|
|
154
|
-
- test/integration/smoke_test.rb
|
|
155
|
-
- test/lookup_test.rb
|
|
156
|
-
- test/method_aliases_test.rb
|
|
157
|
-
- test/mongoid_test.rb
|
|
158
|
-
- test/mongoid_test_helper.rb
|
|
159
|
-
- test/near_test.rb
|
|
160
|
-
- test/oauth_util_test.rb
|
|
161
|
-
- test/proxy_test.rb
|
|
162
|
-
- test/query_test.rb
|
|
163
|
-
- test/request_test.rb
|
|
164
|
-
- test/result_test.rb
|
|
165
|
-
- test/services_test.rb
|
|
166
|
-
- test/test_helper.rb
|
|
167
|
-
- test/test_mode_test.rb
|
|
182
|
+
- lib/tasks/maxmind.rake
|
|
168
183
|
homepage: http://www.rubygeocoder.com
|
|
169
|
-
licenses:
|
|
170
|
-
|
|
184
|
+
licenses:
|
|
185
|
+
- MIT
|
|
186
|
+
metadata:
|
|
187
|
+
source_code_uri: https://github.com/alexreisner/geocoder
|
|
188
|
+
changelog_uri: https://github.com/alexreisner/geocoder/blob/master/CHANGELOG.md
|
|
171
189
|
post_install_message:
|
|
172
190
|
rdoc_options: []
|
|
173
191
|
require_paths:
|
|
174
192
|
- lib
|
|
175
193
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
176
194
|
requirements:
|
|
177
|
-
- -
|
|
195
|
+
- - ">="
|
|
178
196
|
- !ruby/object:Gem::Version
|
|
179
|
-
version:
|
|
197
|
+
version: 2.0.0
|
|
180
198
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
181
199
|
requirements:
|
|
182
|
-
- -
|
|
200
|
+
- - ">="
|
|
183
201
|
- !ruby/object:Gem::Version
|
|
184
202
|
version: '0'
|
|
185
203
|
requirements: []
|
|
186
|
-
|
|
187
|
-
rubygems_version: 2.0.2
|
|
204
|
+
rubygems_version: 3.1.2
|
|
188
205
|
signing_key:
|
|
189
206
|
specification_version: 4
|
|
190
207
|
summary: Complete geocoding solution for Ruby.
|