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

e_log’s picture

Issue summary: View changes

Formatting problem resolved.

e_log’s picture

This 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. ;)

Brandonian’s picture

Its on my short list to take care of this afternoon.

Brandonian’s picture

Status: Active » Fixed

Committed a fix to formula input. Thanks, @e_log!

http://drupalcode.org/project/geofield.git/commit/ed0e916

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Anonymous’s picture

Issue summary: View changes

deleted useless sentence.