Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 85EF2632898 for ; Wed, 1 Sep 2010 10:42:20 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 74038-02 for ; Wed, 1 Sep 2010 13:42:11 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id E172A63265B for ; Wed, 1 Sep 2010 10:42:12 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o81DgBsE023342; Wed, 1 Sep 2010 09:42:11 -0400 (EDT) To: Gary Fu cc: pgsql-sql@postgresql.org Subject: Re: polygon overlay In-reply-to: References: Comments: In-reply-to Gary Fu message dated "Tue, 31 Aug 2010 17:14:24 -0400" Date: Wed, 01 Sep 2010 09:42:10 -0400 Message-ID: <23341.1283348530@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-5 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201009/3 X-Sequence-Number: 34534 Gary Fu writes: > I don't see any overlap between the polygon and the box in the following > sql. Can anyone explain why it returns 't'? > select polygon(path '((0,0),(10,10),(20,10),(10,0))') && polygon(box > '((16,0),(17,1))'); > ?column? > ---------- > t > (1 row) Up to 8.4 the poly_overlap function did this: * Determine if polygon A overlaps polygon B by determining if * their bounding boxes overlap. * * XXX ought to do a more correct check! I see it's been improved for 9.0 ... regards, tom lane