[postgis-devel] Non-Join Join
Martin Davis
mbdavis at refractions.net
Fri Jul 18 14:28:04 PDT 2008
And I nominate you to post this to the PostGIS wiki! 8^)
Martin Davis wrote:
> I bow to the master.
>
> Obe, Regina wrote:
>> 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
More information about the postgis-devel
mailing list