-
Notifications
You must be signed in to change notification settings - Fork 245
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flat isn't flat enough #104
Comments
module Geokit
module ActsAsMappable
module ClassMethods
# Returns the distance calculation to be used as a display column or a condition. This
# is provide for anyone wanting access to the raw SQL.
def distance_sql(origin, units=default_units, formula=default_formula)
case formula
when :sphere
sql = sphere_distance_sql(origin, units)
when :flat
sql = flat_distance_sql(origin, units)
when :neanderthal
sql = neanderthal_distance_sql(origin, units)
end
sql
end
# Returns the distance SQL using the really flat-world formula (Phythagorean Theory).
def neanderthal_distance_sql(origin, units)
adapter.flat_distance_sql(origin, 1.0, 1.0)
end
end
end
end |
@kwerle If you can do this in the form of a pull request which passes the tests and doesn't reduce coverage I'll likely be happy to merge. |
OK, I'll take a stab at it in the near future. Thanks! |
@mnoack How do you run tests for this? It looks like rake test should work (and do sqlite testing), but it does not seem to do so:
|
Ping. I'd really like a hand running tests. |
I have to be bug for bug compatible with some existing code.
default_formula: :flat
still looks at the earth as a sphere - just a rougher one. I need
default_formula: :neanderthal
Sigh.
The text was updated successfully, but these errors were encountered: