[postgis-users] Cut a hole in a line layer (opposite of a cookie cutter)??

Matt Doughty matt.doughty at geograma.com
Mon Jun 4 03:54:21 PDT 2007


Hi,

 

I've got a new problem... how in PostGIS could I perform the opposite of
a cookie cutting operation? Better said, use a polygon layer to cut a
hole in a line layer thereby keeping the lines from outside the polygons
but not those inside. I've been trying with a cooking cutting script
(see below) by placing NOT before the operators but without much luck.

 

SELECT 

            cookie.gid,

            INTERSECTION(cookie.the_geom, cutter.the_geom) AS the_geom

INTO

            curvas_isla_not_02

FROM 

            roads AS cookie, 

            urban_areas AS cutter

WHERE 

            cookie.the_geom && cutter.the_geom

AND 

            INTERSECTS(cookie.the_geom, cutter.the_geom)

 

I've also tried to use the results from the cookie cutter script to
select those lines that don't coincide with those from the cookie (see
below), but also without any luck.

 

SELECT 

            roads.gid,

            roads.the_geom

INTO

            roads_not_urban

FROM 

            roads,

            roads_urban

WHERE 

            roads.the_geom && roads_urban.the_geom

AND 

            NOT INTERSECTS(roads.the_geom, roads_urban.the_geom);

 

If anybody's got any tips on how to do this, or advice on where I'm
going wrong....!

 

Many thanks,

 

Matt

 

 

 

 

Matt Doughty

 

GEOGRAMA S.L.

Tel.:  +34 945 13 13 72    652 77 14 15

Fax: +34 945 23 03 40 

www.geograma.com

 

 

 

 

 

 

 

 

 

 

 

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070604/01c8eb66/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 3743 bytes
Desc: image001.jpg
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070604/01c8eb66/attachment.jpg>


More information about the postgis-users mailing list