<HTML dir=ltr><HEAD><TITLE>Re: [postgis-devel] Non-Join Join</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.6000.16674" name=GENERATOR></HEAD>
<BODY>
<DIV id=idOWAReplyText39329 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>Martin,</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV></DIV>
<DIV dir=ltr>Done.  I guess it should go in the official docs too as an example of ST_DWithin.</DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr><A href="http://postgis.refractions.net/support/wiki/index.php?ExamplesAntiNear">http://postgis.refractions.net/support/wiki/index.php?ExamplesAntiNear</A></DIV>
<DIV dir=ltr> </DIV>
<DIV dir=ltr>Also I think Queen is more fitting than master don't you think :)<BR></DIV>
<DIV dir=ltr>Thanks,</DIV>
<DIV dir=ltr>Regina</DIV>
<DIV dir=ltr>
<HR tabIndex=-1>
</DIV>
<DIV dir=ltr><FONT face=Tahoma size=2><B>From:</B> postgis-devel-bounces@postgis.refractions.net on behalf of Martin Davis<BR><B>Sent:</B> Fri 7/18/2008 5:28 PM<BR><B>To:</B> PostGIS Development Discussion<BR><B>Subject:</B> Re: [postgis-devel] Non-Join Join<BR></FONT><BR></DIV>
<DIV>
<P><FONT size=2>And I nominate you to post this to the PostGIS wiki!  8^)<BR><BR>Martin Davis wrote:<BR>> I bow to the master.<BR>><BR>> Obe, Regina wrote:<BR>>> Wrong Martin.  Find all that are within 1000 with a left join using an<BR>>> indexed search and then throw out those that don't have matches.<BR>>> If it has no neighbor within 1000 feet then all its neighbors must be<BR>>> more than 1000 feet away.<BR>>><BR>>> -----Original Message-----<BR>>> From: postgis-devel-bounces@postgis.refractions.net<BR>>> [<A href="mailto:postgis-devel-bounces@postgis.refractions.net">mailto:postgis-devel-bounces@postgis.refractions.net</A>] On Behalf Of<BR>>> Martin Davis<BR>>> Sent: Friday, July 18, 2008 5:21 PM<BR>>> To: PostGIS Development Discussion<BR>>> Subject: Re: [postgis-devel] Non-Join Join<BR>>><BR>>> Since you're trying to find all As which are *further* than a given<BR>>> distance from Bs, I don't think there is any "efficient" way.<BR>>><BR>>> I think you pretty much have to do a self-join with a where condition<BR>>> like "where distance(geomA, geomB) > 1000".  Oh, and I guess you'll need<BR>>><BR>>> a filter condition to compare only As and Bs.<BR>>><BR>>> Paul Ramsey wrote:<BR>>> <BR>>>> Brain freeze:<BR>>>><BR>>>> Give a table<BR>>>><BR>>>> gid integer<BR>>>> geom geometry<BR>>>> letter varchar<BR>>>><BR>>>> where letter is a single letter,<BR>>>><BR>>>> how to efficiently find all the instances of the letter 'A' that are<BR>>>> more than 1000m from any letter 'B'.<BR>>>><BR>>>> P.<BR>>>> _______________________________________________<BR>>>> postgis-devel mailing list<BR>>>> postgis-devel@postgis.refractions.net<BR>>>> <A href="http://postgis.refractions.net/mailman/listinfo/postgis-devel">http://postgis.refractions.net/mailman/listinfo/postgis-devel</A><BR>>>><BR>>>>      <BR>>><BR>>>  <BR>><BR><BR>--<BR>Martin Davis<BR>Senior Technical Architect<BR>Refractions Research, Inc.<BR>(250) 383-3022<BR><BR>_______________________________________________<BR>postgis-devel mailing list<BR>postgis-devel@postgis.refractions.net<BR><A href="http://postgis.refractions.net/mailman/listinfo/postgis-devel">http://postgis.refractions.net/mailman/listinfo/postgis-devel</A><BR></FONT></P></DIV></BODY></HTML>
<HTML><BODY><P><hr size=1></P>
<P><STRONG>
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.
</STRONG></P></BODY></HTML>

<P><hr size=1></P>
<P><STRONG><font size="2" color="339900"> Help make the earth a greener place. If at all possible resist printing this email and join us in saving paper. </p> <p> </font></STRONG></P>