Something like this should work:<br><br>select this.*,that.* from this,that where this.name='thisplace' and that.name='thatplace' order by distance(this.geom,that.geom) asc limit 1<br><br><div><span class="gmail_quote">On 12/4/06,
<b class="gmail_sendername">Øyvind Vestavik</b> <<a href="mailto:oyvindve@idi.ntnu.no">oyvindve@idi.ntnu.no</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Hi,<br><br>I'm fairly new to GIS/Postgis and I have a problem I'n not sure how to<br>solve. In a Geographic Information Retrieval Application I locate<br>placenames in text. Since several places/locations can have the same
<br>place name, I have to disambiguate the name/find their<br>referent/location.<br><br>For each placename there is a set of 1-M locations in the database, and<br>one of these locations/points is the correct one. To determine which one
<br>it is I want to find the point in the set which is closest to the points<br>in the other sets. Problem is that I have to choose one of many points<br>in the other sets as well.<br><br>So my problem is how to choose one point in each set so that the
<br>distances between the points are as low as possible.<br><br>Is there any way of doing this as one operation in the database, or will<br>I have to write a function for this?<br><br>Any hints appreciated ..<br><br>--<br>
Kind Regards<br>Øyvind Vestavik<br><br>_______________________________________________<br>postgis-users mailing list<br><a href="mailto:postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br><a href="http://postgis.refractions.net/mailman/listinfo/postgis-users">
http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br></blockquote></div><br><br clear="all"><br>-- <br>************************************<br>David William Bitner