geo-spider 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/geo-spider/extractors/postcode.rb +4 -5
- data/lib/geo-spider/version.rb +1 -1
- metadata +1 -1
@@ -14,18 +14,17 @@ module GeoSpider
|
|
14
14
|
results = @element.inner_html.scan(REGEXP)
|
15
15
|
results = results.map(&:first)
|
16
16
|
|
17
|
-
|
17
|
+
found_locations = []
|
18
18
|
|
19
19
|
results.each do |result|
|
20
20
|
begin
|
21
21
|
p = geocoder.locate(result)
|
22
|
-
|
23
|
-
rescue Graticule::Error
|
22
|
+
found_locations << Location.new(:latitude => p.latitude, :longitude => p.longitude, :title => result)
|
23
|
+
rescue Graticule::Error => e
|
24
24
|
next
|
25
25
|
end
|
26
|
-
|
27
|
-
return locations
|
28
26
|
end
|
27
|
+
return found_locations
|
29
28
|
end
|
30
29
|
|
31
30
|
# You need to set a valid Yahoo API key before the UK postcode geocoding will work. Yahoo have vastly better UK postcode accuracy than the other large mapping providers, apart from perhaps Multimap.
|
data/lib/geo-spider/version.rb
CHANGED