[postgis-devel] Non-Join Join

Obe, Regina robe.dnd at cityofboston.gov
Fri Jul 18 14:18:57 PDT 2008


Wrong Martin.  Find all that are within 1000 with a left join using an
indexed search and then throw out those that don't have matches.  

If it has no neighbor within 1000 feet then all its neighbors must be
more than 1000 feet away.

-----Original Message-----
From: postgis-devel-bounces at postgis.refractions.net
[mailto:postgis-devel-bounces at postgis.refractions.net] On Behalf Of
Martin Davis
Sent: Friday, July 18, 2008 5:21 PM
To: PostGIS Development Discussion
Subject: Re: [postgis-devel] Non-Join Join

Since you're trying to find all As which are *further* than a given 
distance from Bs, I don't think there is any "efficient" way.

I think you pretty much have to do a self-join with a where condition 
like "where distance(geomA, geomB) > 1000".  Oh, and I guess you'll need

a filter condition to compare only As and Bs.

Paul Ramsey wrote:
> Brain freeze:
>
> Give a table
>
> gid integer
> geom geometry
> letter varchar
>
> where letter is a single letter,
>
> how to efficiently find all the instances of the letter 'A' that are
> more than 1000m from any letter 'B'.
>
> P.
> _______________________________________________
> postgis-devel mailing list
> postgis-devel at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-devel
>
>   

-- 
Martin Davis
Senior Technical Architect
Refractions Research, Inc.
(250) 383-3022

_______________________________________________
postgis-devel mailing list
postgis-devel at postgis.refractions.net
http://postgis.refractions.net/mailman/listinfo/postgis-devel
-----------------------------------------
The substance of this message, including any attachments, may be
confidential, legally privileged and/or exempt from disclosure
pursuant to Massachusetts law. It is intended
solely for the addressee. If you received this in error, please
contact the sender and delete the material from any computer.




More information about the postgis-devel mailing list