[postgis-users] Link beween the_geom of 2 tables

BladeOfLight16 bladeoflight16 at gmail.com
Thu Aug 1 14:18:52 PDT 2013


On Thu, Jul 18, 2013 at 11:15 AM, Melin Maxence <maxencemelin at yahoo.fr>wrote:
>
> Do you know if it is possible to have in the_geom field of one record in a
> table A, a link (query, hypertext, something else...) to the_geom field of
> another record in a different table (table B), so that when the geom is
> modified in the record of the table A, it is automatically modified in the
> related record of the table B ?
>

It sounds like you need foreign
keys<http://www.postgresql.org/docs/9.2/static/tutorial-fk.html>.
You can then obtain the geometry using a JOIN as Rich mentioned. Whether A
should reference B or vice versa or it's appropriate to have a separate
table would depend on the particular situation. That said, this is only the
case if the geometries in the table are supposed to be identical. If what
you're really after is to clip a geometry or something of that nature, I
imagine a topology might be more suited to your needs, but you could
potentially accomplish such modification with triggers as Rich mentioned.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20130801/72382263/attachment.html>


More information about the postgis-users mailing list