[postgis-users] Join Help

Stephen Woodbridge woodbri at swoodbridge.com
Sun Feb 4 11:55:22 PST 2007


Great! Thanks Paul, that did the trick.

I have also been able to circumvent the numerics problem. It seems that 
if I aways work with my source data I don't have a problem, but if I try 
to reuse the intersection() results in a subsequent difference() I run 
into the numerics problem I posted about earlier.

As always, I appreciate the great product and the support from the list. 
I look forward to working with GEOS 3 also.

Thanks,
   -Steve

Paul Ramsey wrote:
> I think you want to take everything in A and remove all the things that 
> have interactions with B. So, loosely:
> 
> select * from A where A.id not in (select A.id where A.geom && B.geom);
> 
> There is probably a more efficient formulation using the SQL EXCEPT clause.
> 
> P
> 
> On 4-Feb-07, at 9:13 AM, Stephen Woodbridge wrote:
> 
>> 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
>>
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at postgis.refractions.net
>> http://postgis.refractions.net/mailman/listinfo/postgis-users
> 
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list