Search by longitude/latitude
Search by longitude/latitude
От:
"Chris Ruprecht" <chrup999@yahoo.com>
Дата:
Hi all, I need to implement "Find all hospitals in a 5 mile radius". Say I have all the coordinates on them stored in a table with the fields longitude and latitude. Has anybody some sample code for that? Best regards, Chris _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com
Re: Search by longitude/latitude
От:
"James Orr" <james@lrgmail.com>
Дата:
Here is some perl code which does what you want. ----- Original Message ----- From: "Chris Ruprecht" To: "pgsql" Sent: Monday, October 08, 2001 8:58 AM Subject: [SQL] Search by longitude/latitude > Hi all, > > I need to implement "Find all hospitals in a 5 mile radius". Say I have all > the coordinates on them stored in a table with the fields longitude and > latitude. Has anybody some sample code for that? > > Best regards, > Chris > > > > _________________________________________________________ > Do You Yahoo!? > Get your free @yahoo.com address at http://mail.yahoo.com > > > ---------------------------(end of broadcast)--------------------------- > TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org >
Re: Search by longitude/latitude
От:
"Colin 't Hart" <cthart@yahoo.com>
Дата:
Better still, check out PostGIS at http://postgis.refractions.net/ Cheers, Colin
Re: Search by longitude/latitude
От:
"Joe Conway" <joseph.conway@home.com>
Дата:
> Hi all, > > I need to implement "Find all hospitals in a 5 mile radius". Say I have all > the coordinates on them stored in a table with the fields longitude and > latitude. Has anybody some sample code for that? > > Best regards, > Chris > Here's a plpgsql function that will do what you need. You might also look at the earthdistance code in contrib if you'd rather have a C function. HTH, Joe