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?

Thanks for your help.

Cheers,
Brook

Tue, 12 May 1998 16:50:31 -0600 (MDT)
Brook Milligan <brook@trillium.NMSU.Edu>
translation of geometric objects
> 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

Wed, 13 May 1998 05:14:23 +0000
"Thomas G. Lockhart" <lockhart@alumni.caltech.edu>
Re: [HACKERS] translation of geometric objects