Skip to content

Commit

Permalink
Do another lookup, just of the postcode, if first lookup fails
Browse files Browse the repository at this point in the history
  • Loading branch information
auxesis committed Nov 5, 2016
1 parent 85242ff commit 1fa5428
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions scraper.rb
Expand Up @@ -84,6 +84,11 @@ def geocode(prosecution)
else
puts "Geocoding #{address}"
a = Geokit::Geocoders::GoogleGeocoder.geocode(address)

if !a.lat && !a.lng
a = Geokit::Geocoders::GoogleGeocoder.geocode(prosecution['postcode'])
end

location = {
'lat' => a.lat,
'lng' => a.lng,
Expand Down

0 comments on commit 1fa5428

Please sign in to comment.