Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>CGI.escape seems to be more accurate than Geokit::Inflector::url_escape.</p> <p>Here are the results of encoding "Elsassers Straße 27"</p> <p><code>&gt;&gt; CGI.escape(address)</code></p> <p><code>=&gt; "Elsassers+Stra%C3%9Fe+27"</code></p> <p>While </p> <p><code>&gt;&gt; Geokit::Inflector::url_escape(address)</code></p> <p><code>=&gt; "Elsassers+Stra%C3e+27"</code></p> <p>The letter ß should show as c39F (as per <a href="http://www.utf8-chartable.de/unicode-utf8-table.pl" rel="nofollow">http://www.utf8-chartable.de/unicode-utf8-table.pl</a>)</p> <p>In addition, debug statement was blowing up (I knew there was a reason to check if debug logging is enabled :)</p> <p>So, here is my solution for GoogleGeocoder3, I guess others will have a similar problem</p> <pre><code>module Geokit module Geocoders class GoogleGeocoder3 &lt; Geocoder def self.do_geocode(address, options = {}) bias_str = options[:bias] ? construct_bias_string_from_options(options[:bias]) : '' address_str = address.is_a?(GeoLoc) ? address.to_geocodeable_s : address #use CGI.escape instead of Geokit::Inflector::url_escape url ="http://maps.google.com/maps/api/geocode/json?sensor=false&amp;address=#{CGI.escape(address_str)}#{bias_str}" res = self.call_geocoder_service(url) return GeoLoc.new if !res.is_a?(Net::HTTPSuccess) json = res.body # escape results of json logger.debug "Google geocoding. Address: #{address}. Result: #{CGI.escape(json)}" return self.json2GeoLoc(json, address) end end end end </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload