[postgis-users] Repost: Intersection not working properly

Craig Feuerherdt craigfeuerherdt at gmail.com
Sun Oct 21 19:41:31 PDT 2007

This is a re-post of a message from last week. I still have not resolved the

I am trying to clip one table using the features in another. My query is as

drop table bio.bnd_evc;
create table bio.bnd_evc as
select a.buf_dist, b.bio_no, b.bio_code, b.evc, b.constcde, b.consstat,
b.density, intersection(a.the_geom, b.the_geom) as the_geom
from bio.bnd_buf as a, bio.evc as b
where a.the_geom && b.the_geom
and a.buf_dist = 1
and intersects(a.the_geom, b.the_geom)

Both tables have a GIST index. The query returns a table, however there are
several polygons from the evc table, within the bnd_buf table, that are
missing. I thought those missing polygons may have had invalid geometries
(which is not the case as isvalid(evc.the_geom) returns TRUE for all
geometries) and buffered the evc layer by 0, however this made no
difference. One of the missing polygons is completely contained by the
selected feature in bnd_buf, but other features that are also completely
contained have been selected. The resultant table also shows (in QGIS)
polygons where there were no evc polygons.

I am at a loss to explain what is going on nor how to correct it.

Thanks in advance,

Craig Feuerhedt
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20071022/f1094bf1/attachment.html>

More information about the postgis-users mailing list