Re: Search by longitude/latitude

From: "Joe Conway" <joseph(dot)conway(at)home(dot)com>
To: "Chris Ruprecht" <chrup999(at)yahoo(dot)com>, "pgsql" <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Search by longitude/latitude
Date: 2001-10-08 15:33:45
Message-ID: 00a701c1500e$9e34a8e0$6cdc10ac@jecw2k1
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> 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

Attachment Content-Type Size
geodist.sql application/octet-stream 625 bytes

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Bruce Momjian 2001-10-08 16:05:16 Re: temporary views
Previous Message Colin 't Hart 2001-10-08 14:13:45 Re: Search by longitude/latitude