Closed (fixed)
Project:
Geofield
Version:
7.x-2.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 Mar 2012 at 21:20 UTC
Updated:
8 Apr 2012 at 16:50 UTC
Hi,
the haversine formula in geofield.views.inc has the wrong input type, witch gives a wrong distance.
( %f * acos( cos( radians(%f) ) * cos( radians(%s) ) * cos( radians(%s) - radians(%d) ) + sin( radians(%f) ) * sin( radians(%s) ) ) )
needs to be:
( %f * acos( cos( radians(%f) ) * cos( radians(%s) ) * cos( radians(%s) - radians(%s) ) + sin( radians(%f) ) * sin( radians(%s) ) ) )
(The earth radius could be interger %d).
Peace,
e_log
Comments
Comment #0.0
e_log commentedFormatting problem resolved.
Comment #1
e_log commentedThis is still not fixed in the latest dev (22.3.)
Mhm did nobody experienced the problem? It gives the wrong distance, someone else should have noticed it by now. ;)
Comment #2
Brandonian commentedIts on my short list to take care of this afternoon.
Comment #3
Brandonian commentedCommitted a fix to formula input. Thanks, @e_log!
http://drupalcode.org/project/geofield.git/commit/ed0e916
Comment #4.0
(not verified) commenteddeleted useless sentence.