Skip site navigation (1) Skip section navigation (2)

Re: BUG #5889: "Intersects" for polygons broken

From: Konrad Garus <konrad(dot)garus(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #5889: "Intersects" for polygons broken
Date: 2011-02-16 15:33:54
Message-ID: AANLkTinUcLmpNGM4gBdyX=1BrQDRLEghh09OEUwa0h0+@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-bugs
2011/2/16 Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>:
> "Konrad Garus" <konrad(dot)garus(at)gmail(dot)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.

Thank you. How about the point of more informative docs that would
explain supported types, automatic conversions and all such caveats
(also for 8.3 and 8.4)?

-- 
Konrad Garus

In response to

Responses

pgsql-bugs by date

Next:From: Khadtare, SharadDate: 2011-02-16 17:15:43
Subject: Bidirectional replication for postgres 9
Previous:From: Tom LaneDate: 2011-02-16 15:31:58
Subject: Re: BUG #5889: "Intersects" for polygons broken

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group