Indexing of geometric data

From: Barry Brown <bbrown(at)ibexa(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Indexing of geometric data
Date: 2000-07-05 20:29:50
Message-ID: 20000705132950.M21476@ibexa.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Greetings,

I'm investigating the use of PostgreSQL to maintain a database of
mapping data. My dataset currently stored latitudes and longitudes as
fixed-precision integers (ie, 37.234 is stored as 37234) in separate
columns: one for latitude, one for longitude.

Postgres has geometric data types, such as point, line, etc, but I'm a
little leary of using them because of performance reasons. For one, the
internal representation of a point is a pair of double-precision floating
point numbers. For a dataset containing millions of points, working
with floats could be expensive, both in storage and computation costs.

Second, I want to be able to do queries like "find all line segments
(or points) that overlap or intersect with a given bounding box." I'm
afraid that without an appropriate index on the set of data points, a
query like that will be extremely slow.

So my questions are: what data structure is used to index a set of points?
Is it a spatially-oriented structure, such as a quadtree, that would make
queries like the example above very fast? Can Postgres be adapted to
use integers instead of floats to store point coordinates?

Thanks!

Barry

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jan Wieck 2000-07-05 20:41:18 Re: PostgreSQL 7.1
Previous Message Tom Lane 2000-07-05 20:29:16 Re: Need help with error