Re: polygon overlay

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Gary Fu <gfu(at)sigmaspace(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: polygon overlay
Date: 2010-09-01 13:42:10
Message-ID: 23341.1283348530@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Gary Fu <gfu(at)sigmaspace(dot)com> 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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message negora 2010-09-02 12:17:34 SUM the result of a subquery.
Previous Message Michael Andrew Babb 2010-09-01 00:58:04 Re: PostGres Tables in ArcSDE and ArcCatalog.