Re: [GENERAL] distance calculation usng lat and long in miles

2006-03-08 Thread Michael Fuhr
On Wed, Mar 08, 2006 at 09:10:39AM -0800, [EMAIL PROTECTED] wrote: > I have the lat and long data. I have created the geom column based on the > lat and long data as below. > > > UPDATE property SET geom =GeometryFromText('POINT(' || long || > ' ' || lat || ')',4326); This looks like Po

Re: [GENERAL] distance calculation usng lat and long in miles

2006-03-08 Thread Uwe C. Schroeder
There is the earthdistance package in the contrib directory. You may want to look into that. On Wednesday 08 March 2006 09:10, [EMAIL PROTECTED] wrote: > I have the lat and long data. I have created the geom column based on the > lat and long data as below. > > > UPDATE property SET geom =Ge

Re: [GENERAL] distance calculation usng lat and long in miles

2006-03-08 Thread brew
> I am calculating the distance as below > > select distance(geom1, geom2)* 69.055 > > > It seems to be right. But I want to make sure. One way to calculate is the Great Circle Distance, that's the way the FCC (Federal Communications Commission) uses to calculate distance between two Radio Stati

[GENERAL] distance calculation usng lat and long in miles

2006-03-08 Thread sunithab
I have the lat and long data. I have created the geom column based on the lat and long data as below. UPDATE property SET geom =GeometryFromText('POINT(' || long || ' ' || lat || ')',4326); Now I have the geom columns in two tables I am calculating the distance as below select distan

Re: [GENERAL] Distance calculation

2006-01-17 Thread Tino Wildenhain
[EMAIL PROTECTED] schrieb: > Hi > > I have a latiude and longitude for a city and latitude, longitude > foreach hotel in hotels table. > > I have to reitreive 20 hotels nearby to that city in 25 miles. The > below is the query I am using to check the distance. But the query is > slow because of

Re: [GENERAL] Distance calculation

2006-01-17 Thread Michael Fuhr
On Tue, Jan 17, 2006 at 10:00:22AM -0800, [EMAIL PROTECTED] wrote: > I have a latiude and longitude for a city and latitude, longitude foreach > hotel in hotels table. > > I have to reitreive 20 hotels nearby to that city in 25 miles. The below > is the query I am using to check the distance. B

Re: [GENERAL] Distance calculation

2006-01-17 Thread John Sidney-Woollett
I'm no expert on this but can't you limit the points to checking any hotel whose lat is +- 25km north/south of your city, AND whose longitude is also +- 25km of your city. It's crude but will probably eliminate lots of points you should never be checking... If you could index an approx lat and

[GENERAL] Distance calculation

2006-01-17 Thread sunithab
Hi I have a latiude and longitude for a city and latitude, longitude foreach hotel in hotels table. I have to reitreive 20 hotels nearby to that city in 25 miles. The below is the query I am using to check the distance. But the query is slow because of distance calulation on fly and order b