[postgis-users] Updated: unexplained results when using Intersection?

Craig Feuerherdt craigfeuerherdt at gmail.com
Wed Oct 31 16:02:39 PDT 2007


Kevin/group,

I thanks for pointing that out and I apologise for confusing the message. I
am trying to 'clip' the evc geometries with the relevant bnd_buf geometry. (
I was trying overlaps and pasted the wrong query into my message.)

I have updated the images to reflect the 'intersects' results. You will
notice in the image
http://www.bendigo-orienteers.com.au/study/evc1_over.png(where bnd_buf
= 1) that there are two internal evc polygons that are not
included in the output. In
http://www.bendigo-orienteers.com.au/study/evc1_under.png you notice that
there are additional polygons where there shouldn't be.

When the query is completed using bnd_buf=1000 similar things occur ie
polygons created where ther shouldn't be
http://www.bendigo-orienteers.com.au/study/evc1000_over.png and evc polygons
missing in the output table
http://www.bendigo-orienteers.com.au/study/evc1000_under.png.

So the original questions remain:
Are the issues associated with having multiple polygon geometries in the one
table (unlikely in my opinion)?
Is it something to do with the query?
Are these issues associated with PostGIS or GEOS?
Is there a work around to solve the issue?

Thanks in advance,

Craig
<http://www.bendigo-orienteers.com.au/study/evc1_under.png>

> Hi Craig,
>
> What is it you are trying to do exactly?
>
> Reading your query, I see that you are interested in the intersection of
> all geometries in "evc" and "bnd_buf" where the geometries overlap (by
> definition, this means that the interior of one polygon is both inside
> and outside that of another polygon) and where "buf_dist" = 1.  So,
> you're not interested in cases where a polygon in "env" is contained
> wholly inside "bnd_buf".  Right?
>
> Did you mean to filter with "overlaps"? Or did you mean "intersects"?
>
> -------------
> Kevin Neufeld
> Software Developer
> Refractions Research Inc.
> 300-1207 Douglas St.
> Victoria, B.C., V8W 2E7
>
> Phone: (250) 383-3022
> Email: kneufeld at refractions.net



Craig Feuerherdt wrote:
> > I have been attempting to intersect on set of geometries (bio.evc)
> > with another geometry (bio.bnd_buf). All the geometries are valid
> > according to isvalid and the query below successfully returns a table.
> >
> > 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 overlaps(a.the_geom, b.the_geom)
> >
> > When I view the resulting table (bnd_evc) in QGIS there are several
> > missing polygons ( image 1a
> > <http://www.bendigo-orienteers.com.au/study/evc1_over.png>). One of
> > the polygons lies entirely within bnd_bnf while the other has a small
> > portion which overlaps the boundary.
> >
> > When I try intersecting the same geometries but this time selecting
> > buf_dist = 1000 (the 1000m buffer), additional evc polygons (which are
> > wholly within buf_dist=1 and therefore also within buf_dist=1000) are
> > missing from the output table and the whole thing is a 'mess' nad is
> > in no way a representation of what the intersection shoul dlook like (
> > image 2a <http://www.bendigo-orienteers.com.au/study/evc1000_over.png>).
> >
> > The other thing that occurs in both cases is that some polygon
> > geometries are created where there are no evc polygons ( image 1b
> > <http://www.bendigo-orienteers.com.au/study/evc1_under.png> & 2b
> > <http://www.bendigo-orienteers.com.au/study/evc1000_under.png>).
> >
> > Both tables have a GIST index on the geometry column (the_geom).
> >
> > Are the issues associated with having multiple polygon geometries in
> > the one table (unlikely in my opinion)?
> > Is it something to do with the query?
> > Are these issues associated with PostGIS or GEOS?
> > Is there a work around to solve the issue?
> >
> > Thanks in advance,
> >
> > Craig
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20071101/118a6797/attachment.html>


More information about the postgis-users mailing list