Skip to content
Snippets Groups Projects
Commit 8e84780d authored by Alex Reisner's avatar Alex Reisner
Browse files

Convert to numbers before comparing.

This fixes issue #260.
parent 19a8c8f2
No related branches found
No related tags found
No related merge requests found
......@@ -56,7 +56,7 @@ module Geocoder::Store
return select(select_clause(nil, "NULL", "NULL")).where(false_condition)
end
spans = "#{geocoder_options[:latitude]} BETWEEN #{sw_lat} AND #{ne_lat} AND "
spans << if sw_lng > ne_lng # Handle a box that spans 180
spans << if sw_lng.to_f > ne_lng.to_f # handle box that spans 180 longitude
"#{geocoder_options[:longitude]} BETWEEN #{sw_lng} AND 180 OR " +
"#{geocoder_options[:longitude]} BETWEEN -180 AND #{ne_lng}"
else
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment