From: Tom Lane <tgl@sss.pgh.pa.us>
To: Konrad Garus <konrad.garus@gmail.com>
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #5889: "Intersects" for polygons broken
Date: Wed, 16 Feb 2011 10:31:58 -0500
Message-ID: <25122.1297870318@sss.pgh.pa.us> (raw)
In-Reply-To: <201102161058.p1GAwS5V009535@wwwmaster.postgresql.org>
References: <201102161058.p1GAwS5V009535@wwwmaster.postgresql.org>
"Konrad Garus" <konrad.garus@gmail.com> writes:
> && operator seems to be broken for polygons whose bounding boxes intersect:
> select polygon'((0,0), (1,2), (0,2))' && polygon'((0.5, 0), (1,0), (1,1))';
> ?column?
> ----------
> t
> (1 row)
This is fixed as of 9.0; see the release notes at
http://www.postgresql.org/docs/9.0/static/release-9-0.html
which say
Correct calculations of "overlaps" and "contains" operations for polygons (Teodor Sigaev)
The polygon && (overlaps) operator formerly just checked to see
if the two polygons' bounding boxes overlapped. It now does a
more correct check. The polygon @> and <@ (contains/contained
by) operators formerly checked to see if one polygon's vertexes
were all contained in the other; this can wrongly report "true"
for some non-convex polygons. Now they check that all line
segments of one polygon are contained in the other.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, konrad.garus@gmail.com
Subject: Re: BUG #5889: "Intersects" for polygons broken
In-Reply-To: <25122.1297870318@sss.pgh.pa.us>
References: <201102161058.p1GAwS5V009535@wwwmaster.postgresql.org> <25122.1297870318@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox