<p>In app/controllers/geocoder_controller.rb:</p>
<pre style='color:#555'>> @@ -312,4 +314,26 @@ def count_results(results)
>    def escape_query(query)
>      return URI.escape(query, Regexp.new("[^#{URI::PATTERN::UNRESERVED}]", false, 'N'))
>    end
> +
> +  def convert_latlon
> +    @query = params[:query]
> +
> +    if latlon = @query.match(/^([NS])\s*(\d{1,3}\.?\d*)\W*([EW])\s*(\d{1,3}\.?\d*)$/).try(:captures) # [NSEW] decimal degrees
> +      params[:query] = view_context.nsew_to_decdeg(latlon)
> +    elsif latlon = @query.match(/^(\d{1,3}\.?\d*)\s*([NS])\W*(\d{1,3}\.?\d*)\s*([EW])$/).try(:captures) # degrees, decimal minutes [NSEW]
> +      params[:query] = view_context.nsew_to_decdeg(latlon)
> +
> +    elsif latlon = @query.match(/^([NS])\s*(\d{1,3})°?\s*(\d{1,3}\.?\d*)?['′]?\W*([EW])\s*(\d{1,3})°?\s*(\d{1,3}\.?\d*)?['′]?$/).try(:captures) # [NSEW] degrees, decimal minutes
</pre>
<p>The first checks for apostrophes (') and single primes (′), the second checks for quotation marks (") and double primes (″). A typographer would correctly use the prime characters, and, indeed, this is what Wikipedia does, so a cut and paste for any country latlon on Wikipedia will fail without them. <code>test_primes_and_double_primes</code> beginning on line 211 looks for these. Believe it's in the commit message.</p>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br>Reply to this email directly or <a href='https://github.com/openstreetmap/openstreetmap-website/pull/216/files#r3200828'>view it on GitHub</a>.<img src='https://github.com/notifications/beacon/uTRSc6ihLa7Shf84BpiOpswm2upcLXkvSUV9Ff7I2X2AMGIam68vFFgovLsKBb-e.gif' height='1' width='1'></p>