[openstreetmap-website] User page redesign a.k.a. activity stream (#54)

Tom Hughes notifications at github.com
Sun Aug 12 16:50:19 BST 2012


> @@ -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)

Please don't duplication the `sql_for_distance` calculation here - just add an extra parameter with a default value (`scale = 1`) and then make this routine call it with a different scale.

---
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/54/files#r1358599
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20120812/0b8e47e5/attachment.html>


More information about the rails-dev mailing list