Re: Fun with Spatial (Haversine formula)

2010-08-20 Thread Yonik Seeley
Lance, have you figured out what the issue is? Anyone know if this is a haversine limitation, or a bug? -Yonik http://lucenerevolution.org Lucene/Solr Conference, Boston Oct 7-8 On Wed, Aug 18, 2010 at 1:54 AM, Lance Norskog goks...@gmail.com wrote: The Haversine formula in

Re: Fun with Spatial (Haversine formula)

2010-08-20 Thread Mattmann, Chris A (388J)
It might have something to do with the source data and its spatial reference system. For example, if the data is in WGS84 then the haversine (great circle) distance precision gets worse the farther away two cities are from each other or for particular regions (e.g. further away from equator).

Re: Fun with Spatial (Haversine formula)

2010-08-20 Thread Lance Norskog
I copied a different formulation out of the Wikipedia article on Haversine. It's the same idea as in DistanceUtils, but turned inside out with cosines instead of sines. It gives exactly the same results. This is not with source data, just using round numbers in the latitude/longitude space. I do

Re: Fun with Spatial (Haversine formula)

2010-08-20 Thread Yonik Seeley
On Fri, Aug 20, 2010 at 11:05 PM, Lance Norskog goks...@gmail.com wrote: are latitudes equidistant on the surface of the sphere? Yes - each degree of latitude is ~69 miles. There is also a slight variation due to the earth not being a perfect sphere. -Yonik http://lucenerevolution.org

Fun with Spatial (Haversine formula)

2010-08-17 Thread Lance Norskog
The Haversine formula in o.a.s.s.f.d.DistanceUtils.java gives these results for a 0.1 degree difference in miles: equator horizontal 0.1 deg: lat/lon 0.0/0.0 - 396.320504 equator vertical 0.1 deg: lat/lon 0.0/0.0 - 396.320504 NYC horizontal 0.1 deg: lat/lon -72.0/0.0