[postgis-users] Join Help

Stephen Woodbridge woodbri at swoodbridge.com
Sun Feb 4 09:13:52 PST 2007


Hi,

How do a construct a query to count the number of polygons in table a 
the have no interaction with any polygon in table b?

select count(*) from a, b where not a.the_geom && b.the_geom

is not it. This seems to count all the polygons in b that do not 
interact with the polygons in a.

So if a has one polygon and b has 100, then the count(*) would be 100 if 
the polygon in a did not interact with any of the polygons in b. Or that 
is at least what I surmise based on the numbers I'm seeing.

Ideas?

-Steve




More information about the postgis-users mailing list