Re: [HACKERS] translation of geometric objects - Mailing list pgsql-hackers

From Thomas G. Lockhart
Subject Re: [HACKERS] translation of geometric objects
Date
Msg-id 35592C2F.A5F2190A@alumni.caltech.edu
Whole thread Raw
In response to translation of geometric objects  (Brook Milligan <brook@trillium.NMSU.Edu>)
List 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

pgsql-hackers by date:

Previous
From: "Thomas G. Lockhart"
Date:
Subject: Re: [HACKERS] outnode error in current source
Next
From: "Göran Thyni"
Date:
Subject: Re: [HACKERS] mmap and MAP_ANON