On May 8, 2005, at 11:26 AM, Andrew Boyd wrote:

Hi All,
  I'm wanting to do some range queries using latitude and longitude.

I have numbers like so:

long           lat
-84.65532   32.74212

What would be the best way to store this in lucene so I can do a range query?

Also for all you smart people out there do you know the distance between the decimal places?
What I mean is if the long is constant what is the distance (miles, kilometers, feet etc) between


32.74213 - 32.74212   = .00001 = ?distance?
32.74222 - 32.74212   = .00010 = ?distance?

Thanks,

Andrew


If longitude is held constant, then each degree of latitude is 111.3171 kilometers.


The distance between degrees of longitude is more complicated and depends upon what latitude you are at.

There are a lot of sites on the web that will do the calculations for you. This one:

<http://jan.ucc.nau.edu/~cvm/latlongdist.html>

will accept a format of either decimal degrees or degrees, minutes, seconds. It is easy to convert between the two knowing that there are 60 minutes in a degree and 60 seconds in a minute.

The above URL also gives the equations for calculating distance assuming you want to write some code to do this.

--
Bill Tschumy
Otherwise -- Austin, TX
http://www.otherwise.com



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to