From: Tom Hughes Date: Sat, 25 Aug 2007 22:33:46 +0000 (+0000) Subject: Correct calculation of reciprocal angles. X-Git-Tag: live~8706 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/a7f00eefc4842a87c9076cac8b70fab5149a732b Correct calculation of reciprocal angles. --- diff --git a/app/controllers/geocoder_controller.rb b/app/controllers/geocoder_controller.rb index 4ed94b649..8abcbdc44 100644 --- a/app/controllers/geocoder_controller.rb +++ b/app/controllers/geocoder_controller.rb @@ -185,7 +185,7 @@ private name = named.attributes["name"].to_s description = named.elements["description"].to_s distance = format_distance(place.attributes["approxdistance"].to_i) - direction = format_direction(360 - place.attributes["direction"].to_i) + direction = format_direction((place.attributes["direction"].to_i - 180) % 360) prefix = "#{distance} #{direction} of #{type} " results.push({:lat => lat, :lon => lon, :zoom => zoom, :prefix => prefix.capitalize, :name => name,