[postgis-users] choosing the "smallest set" of points
David William Bitner
david.bitner at gmail.com
Mon Dec 4 07:26:06 PST 2006
Something like this should work:
select this.*,that.* from this,that where this.name='thisplace' and
that.name='thatplace' order by distance(this.geom,that.geom) asc limit 1
On 12/4/06, Øyvind Vestavik <oyvindve at idi.ntnu.no> wrote:
>
>
> Hi,
>
> I'm fairly new to GIS/Postgis and I have a problem I'n not sure how to
> solve. In a Geographic Information Retrieval Application I locate
> placenames in text. Since several places/locations can have the same
> place name, I have to disambiguate the name/find their
> referent/location.
>
> For each placename there is a set of 1-M locations in the database, and
> one of these locations/points is the correct one. To determine which one
> it is I want to find the point in the set which is closest to the points
> in the other sets. Problem is that I have to choose one of many points
> in the other sets as well.
>
> So my problem is how to choose one point in each set so that the
> distances between the points are as low as possible.
>
> Is there any way of doing this as one operation in the database, or will
> I have to write a function for this?
>
> Any hints appreciated ..
>
> --
> Kind Regards
> Øyvind Vestavik
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
--
************************************
David William Bitner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20061204/99f2207d/attachment.html>
More information about the postgis-users
mailing list