lib/geokit/geocoder_google_v3.rb in sayso-geokit-1.5.0.3.002 vs lib/geokit/geocoder_google_v3.rb in sayso-geokit-1.5.0.3.003
- old
+ new
@@ -162,10 +162,10 @@
res.full_address = placemark['formatted_address']
res.street_address = res.full_address.sub(Regexp.new("^(.*#{res.street})([^,]*)?(.*)$")){|full_addr| "#{$1}#{$2}"} if res.street
# Translate accuracy into Yahoo-style token address, street, zip, zip+4, city, state, country
# For Google, 1=low accuracy, 8=high accuracy
- res.accuracy = ACCURACY[placemark['types'][0]] || 0
+ res.accuracy = (ACCURACY[placemark['types'][0]]).to_i # if ACCURACY[placemark['types'][0]] is empty or nil, 0 will be returned
res.precision = %w{unknown country state state city zip zip+4 street address building}[res.accuracy]
# google returns a set of suggested boundaries for the geocoded result
if (suggested_bounds = placemark['geometry']['viewport'] || placemark['geometry']['bounds'])
res.suggested_bounds = Bounds.normalize(