[postgis-users] Problem with the overlap operator && (?)

Gregory S. Williamson gsw at globexplorer.com
Tue Nov 14 20:40:07 PST 2006


Without examples of the data involved, it's hard to say for sure, but offhand perhaps the && operator, which uses bounding boxes only, does find that the 2nd object's BB overlaps the first object's BB, but the stricter (and slower, non-index using, "overlaps" function) is correctly seeing that they do not really overlap. Think of a "C" shape with a much smaller circle in the open area in the middle ... or a shape that has a long diagonal, so the bounding box embraces a large are compared to the actual area of the shape. 

If you can reduce this to a simple case and show the geometries I am sure that smarter heads than mine could chime in.


Greg Williamson
GlobeXplorer LLC

-----Original Message-----
From:	postgis-users-bounces at postgis.refractions.net on behalf of Rob Tester
Sent:	Tue 11/14/2006 8:21 PM
To:	postgis-users at postgis.refractions.net
Subject:	[postgis-users] Problem with the overlap operator && (?)

I recently (with my install of 1.1.5) have run into something that is
puzzling me about the overlaps operator. I have two tables that I am
comparing the geometry objects using the following SQL:

select overlaps(a.wkb_geometry,b.wkb_geometry),a.primaryKey,b.primaryKey
from az_cr9 a,az_kz b where a.primaryKey=2203 and b.primaryKey=293546 and

This returns one row:


My question is how does the overlaps operator return TRUE and the overlaps
function return FALSE. In fact the two geometries in question do not close
to each other. Is this operator broken?

This query returns no rows as expected:

from az_carrierroute9 a,az_kz_calculated_test b where a.ogc_fid=2203 and
b.ogc_fid=293546 and overlaps(a.wkb_geometry,b.wkb_geometry)

Any help on this?


Click link below if it is SPAM gsw at globexplorer.com

More information about the postgis-users mailing list