Skip site navigation (1) Skip section navigation (2)

Re: [HACKERS] Indexing for geographic objects?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Franck Martin <franck(at)sopac(dot)org>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] Indexing for geographic objects?
Date: 2000-11-26 04:35:40
Message-ID: 28140.975213340@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-generalpgsql-hackers
Franck Martin <franck(at)sopac(dot)org> writes:
> I would greatly appreciate if someone could guide me through the
> methodology to build an index for a custom type or point me to some
> readings where the algorithm is explained (web, book, etc...).

The Programmer's Guide chapter "Interfacing Extensions To Indices"
outlines the procedure for making a new datatype indexable.  It
only discusses the case of adding btree support for a new type,
though.  For other index classes such as R-tree there are different
sets of required operators, which are not as well documented but
you can find out by looking at code for the already-supported
datatypes.

> I plan to use 3D geographical objects...

That's a bit hard since we don't have any indexes suitable for 3-D
coordinates --- the existing R-tree type is for 2-D objects.  What's
more it assumes that coordinates are Euclidean, which is probably
not the model you want for geographical coordinates.

In theory you could build a new index type suitable for indexing
3-D points, using the R-tree code as a starting point.  I wouldn't
class it as a project suitable for a newbie however :-(.

Depending on what your needs are, you might be able to get by with
projecting your objects into a flat 2-D coordinate system and using
an R-tree index in that space.  It'd just be approximate but that
might be close enough for index purposes.

			regards, tom lane

In response to

pgsql-hackers by date

Next:From: Alain ToussaintDate: 2000-11-26 05:07:46
Subject: Re: Re: [NOVICE] Re: re : PHP and persistent connections
Previous:From: Tom LaneDate: 2000-11-26 02:55:18
Subject: Proposal for fixing IPC key assignment

pgsql-general by date

Next:From: Andrew McMillanDate: 2000-11-26 10:33:39
Subject: Re: Skipping numbers in a sequence.
Previous:From: GHDate: 2000-11-26 01:39:13
Subject: Re: PostgreSQL as windows 2000 Service

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group