<p>In lib/osm.rb:</p>
<pre style='color:#555'>> @@ -365,6 +365,11 @@ def bounds(radius)
>      def sql_for_distance(lat_field, lon_field)
>        "6372.795 * 2 * asin(sqrt(power(sin((radians(#{lat_field}) - #{@lat}) / 2), 2) + cos(#{@lat}) * cos(radians(#{lat_field})) * power(sin((radians(#{lon_field}) - #{@lon})/2), 2)))"
>      end
> +
> +    # get the SQL to use to calculate distance (assumes that lat_field and lon_field contain scaled integers)
> +    def sql_for_distance_scaled(lat_field, lon_field)
</pre>
<p>Please don't duplication the <code>sql_for_distance</code> calculation here - just add an extra parameter with a default value (<code>scale = 1</code>) and then make this routine call it with a different scale.</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/54/files#r1358599'>view it on GitHub</a>.
            </p>
            <img src='https://github.com/notifications/beacon/uTRSc6ihLa7Shf84BpiOpmLWAu4oQih75mggZl1E8_ncpsL_vuCSTJlxIVuE64FQ.gif' height='1' width='1'>