[postgis-users] intersection

Emilie Laffray emilie.laffray at gmail.com
Tue Sep 29 09:33:22 PDT 2009


2009/9/29 eehab hamzeh <eehab40 at hotmail.com>

>  hello all,
>
> I need to know the id of the object that are intersect, i use the following
> query. can any body help to develop it to contain the id.
>
>
> CREATE TABLE example_intersections_b AS (
>     SELECT  DISTINCT st_intersects(part_1.the_geom, part_2.the_geom)
>       FROM  source AS part_1,
>            faces_obj AS part_2
>      WHERE part_1.id <> part_2.id
> );
>

CREATE TABLE example_intersections_b AS
(
   SELECT  DISTINCT st_intersects(part_1.the_geom, part_2.the_geom),
                 part_1.id,
                 part_2.id
      FROM  source AS part_1,
           faces_obj AS part_2
     WHERE part_1.id <> part_2.id
);

You don't need anything complicated here. Just add your ids directly in your
SELECT query.

Emilie Laffray
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20090929/db2e7468/attachment.html>


More information about the postgis-users mailing list