[postgis-users] Problem with Intersection(Geometry, Geometry)

Matt Doughty matt.doughty at geograma.com
Wed Nov 21 03:25:27 PST 2007


Hi,

 

We've managed to solve the problem with the cookie cutter. The quick (and quite smart) solution was to generate a buffer of the geometries of 0 distance, thereby creating the buffer around all the geometries, lines and polygons, thus rendering insignificant the linestring problem.

 

Cheers,

 

Matt

 

PS. Here's the code if anybodies interested.

 

SELECT 

            buffer(INTERSECTION(<cookie>.the_geom, <cutter>.the_geom),0) AS the_geom

INTO

            <output>

FROM 

            <cookie>, 

            <cutter>

WHERE 

            <cookie>.the_geom && <cutter>.the_geom

AND 

            intersects(<cookie>.the_geom, <cutter>.the_geom);

 

 

 

Matt Doughty

 

GEOGRAMA S.L.

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

Fax: +34 945 23 03 40 

www.geograma.com

 

 

________________________________

De: postgis-users-bounces at postgis.refractions.net [mailto:postgis-users-bounces at postgis.refractions.net] En nombre de Matt Doughty
Enviado el: miércoles, 21 de noviembre de 2007 8:16
Para: postgis-users at postgis.refractions.net
Asunto: [postgis-users] Problem with Intersection(Geometry, Geometry)

 

Hi all,

 

I'm having some problems with the intersection function that I've been trying to use as a Cookie cutter command.

 

I've been executing the following script:

 

SELECT 

            INTERSECTION(<cookie>.the_geom, <cookie-cutter>.the_geom) AS the_geom

INTO

            <output>

FROM 

            <cookie>, 

            <cookie-cutter>

WHERE 

            <cookie>.the_geom && <cookie-cutter>.the_geom

AND 

            intersects(<cookie>.the_geom, <cookie-cutter>.the_geom);

 

The problem it gives me is that polygons which need to be cut don't turn out right. The output retuns to the geometry column a GeometryCollection for the polygon in question. This is composed of one polygon, which is what I want, and a collection of linestrings, each of which represents a segment of the boundary of the cutting polygon, which obviously I don't want.

 

Has anybody come across this and how can I solve the problem?

 

Cheers,

 

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/20071121/2edb8869/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/20071121/2edb8869/attachment.jpg>


More information about the postgis-users mailing list