Given

        CREATE TABLE outline (
                id,
                the_geom
        );

and

        CREATE TABLE polys (
                id,
                the_geom
        );

I want to update polys.the_geom with only those that are clipped by "outline". 
That is, all the "polys" that are completely within the ouline.the_geom rows 
should remain intact, all those that are intersected should only have there 
overlapping portion retained, and all that are outside outline.the_geom should 
be set to null.

I am unable to figure out how to do this in one query. The following doesn't 
work

        UPDATE  polys
        SET     the_geom = ST_Intersection(o.the_geom, p.the_geom)
        FROM    outline o JOIN 
                polys p ON ST_Intersects(o.the_geom, p.the_geom)
        WHERE   ST_Intersects(o.the_geom, p.the_geom) = 'true';



--
Puneet Kishor
_______________________________________________
postgis-users mailing list
postgis-users@postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to