Re: [HACKERS] translation of geometric objects

From: "Thomas G(dot) Lockhart" <lockhart(at)alumni(dot)caltech(dot)edu>
To: Brook Milligan <brook(at)trillium(dot)nmsu(dot)edu>
Cc: pgsql-hackers(at)hub(dot)org
Subject: Re: [HACKERS] translation of geometric objects
Date: 1998-05-13 05:14:23
Message-ID: 35592C2F.A5F2190A@alumni.caltech.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> I need to translate some geometric objects and discovered that only a
> few provide the plus/minus operators for translation. However, it
> seems like a trivial job to add or subtract an (x,y) pair from any
> geometric object since they are all based on a series of points. I
> don't mind working on the code, but I cannot seem to find out where
> the code is.
> Can anyone give me a little guidance on what files to modify (and
> whether there are any tricks to integrating it) so that I can expand
> the range of geometric objects that can be translated?

It looks like point, box, path, and circle are supported, but perhaps
only in one combination (e.g. box + point but not point + box). Looks
like lseg, line, and polygon are missing altogether. I'd like to have
the parser able to match up commutative operators by swapping arguments
so we only would need to provide one of the combinations for the "+"
operator, for example. Haven't done this yet and don't know how
difficult it will be.

Anyway, the files to modify are:

src/backend/utils/adt/geo_ops.c
src/include/utils/geo_decls.h
src/include/catalog/pg_proc.h
src/include/catalog/pg_oper.h

There are some tricks to adding things to the catalogs; if you want to
generate code for the geo_xxx files I'll contribute the catalog stuff.
Send me patches on the current development source tree and I'll send
back patches on the catalog for same.

If you want to do the catalog stuff yourself, use ./unused_oids and
./duplicate_oids to help select which oids are available for new entries
in the built-in catalogs.

- Tom

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Gran Thyni 1998-05-13 06:17:12 Re: [HACKERS] mmap and MAP_ANON
Previous Message Thomas G. Lockhart 1998-05-13 05:00:41 Re: [HACKERS] outnode error in current source