Points, Circles, Indexes, and query-by-Radius?

From: Bryan Field-Elliot <bryan_lists(at)netmeme(dot)org>
To: pgsql-general(at)postgresql(dot)org
Subject: Points, Circles, Indexes, and query-by-Radius?
Date: 2001-08-02 19:53:44
Message-ID: 3B69AFC8.8090001@netmeme.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I'm developing a GIS system on PostgreSQL. I need to store a table of
points (latitude and longitude), and do queries such as "return all
points enclosed with the given circle ((X,Y),R)".

The "point" data type looks convenient, however, it doesn't appear to be
indexable.

Can anyone tell me what the preferred, recommended strategy for this
design pattern is, with respect to PostgreSQL? One which makes good use
of indices, if possible (realizing that I personally don't know a good
way to index for a radius search).

For extra credit, it would be nice if I could store circles instead of
points, and issue queries like the following:

"given a circle ((X,Y),R), return all circles which share some common area"

Opinions would be appreciated -- I looked at the online docs, but could
not find any discussion about optimizing this kind of data schema and
query requirement.

Thank you,

Bryan

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Paul Ramsey 2001-08-02 20:07:24 Re: Points, Circles, Indexes, and query-by-Radius?
Previous Message Jason Earl 2001-08-02 19:50:54 Re: Re: [HOW TO:] timestamp WITHOUT timezone