Indexing of geometric data - Mailing list pgsql-general

From Barry Brown
Subject Indexing of geometric data
Date
Msg-id 20000705132950.M21476@ibexa.com
Whole thread Raw
List 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

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Need help with error
Next
From: JanWieck@t-online.de (Jan Wieck)
Date:
Subject: Re: PostgreSQL 7.1