<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><pre>This query from <br><a href="http://postgis.refractions.net/pipermail/postgis-users/2009-April/023265.html">http://postgis.refractions.net/pipermail/postgis-users/2009-April/023265.html</a><br>should give you an idea of how to do this.<br><br>The radius is an arbitrary value to avoid a full table scan. <br><br>If you already know which feature is closest & just want the<br>closest vertex from that feature, add a where clause to include <br>just that feature.<br><br>HTH<br><br>  Brent Wood<br><br>><i> select * from vertices_tmp where <br></i>><i> st_expand(setsrid(makepoint(x,y),4326),radius)</i><i> && the_geom <br>> order by distance(setsrid(makepoint(x,y),4326),the_geom) asc<br></i>><i> limit 1;<br></i></pre><br><br>--- On <b>Sun, 5/22/11, Александр Дымчишин <i><dymchishin@gmail.com></i></b>
 wrote:<br><blockquote style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"><br>From: Александр Дымчишин <dymchishin@gmail.com><br>Subject: [postgis-users] Fwd: Hello everyone, That is my first message.I am using PostGIS not so long and so I ask you to help me.<br>To: postgis-users@postgis.refractions.net<br>Date: Sunday, May 22, 2011, 8:35 AM<br><br><div id="yiv246961797"><span lang="en"><span title="Нажмите, чтобы увидеть альтернативный перевод">I</span><span title="Нажмите, чтобы увидеть альтернативный перевод">'m trying to solve</span> <span title="Нажмите, чтобы увидеть альтернативный перевод">the transport</span> <span title="Нажмите, чтобы увидеть альтернативный перевод">problem</span> <span title="Нажмите, чтобы
 увидеть альтернативный перевод">and</span> <span title="Нажмите, чтобы увидеть альтернативный перевод">make the</span> <span title="Нажмите, чтобы увидеть альтернативный перевод">visualization</span> <span title="Нажмите, чтобы увидеть альтернативный перевод">using</span> <span title="Нажмите, чтобы увидеть альтернативный перевод">Geotools. In attached pic that is what I mean. My car is between V3 and V4. </span></span><span lang="en"><span title="Нажмите, чтобы увидеть альтернативный перевод">Its position</span> <span title="Нажмите, чтобы увидеть альтернативный перевод">can I</span> <span title="Нажмите, чтобы увидеть альтернативный
 перевод">get</span> <span title="Нажмите, чтобы увидеть альтернативный перевод">with</span> <span title="Нажмите, чтобы увидеть альтернативный перевод">a query</span><span title="Нажмите, чтобы увидеть альтернативный перевод"> like "</span></span><code><b>SELECT ST_Line_Interpolate_Point</b>(</code><var>linestring</var>1, 0.6<var></var><code>)</code>;<span lang="en"><span title="Нажмите, чтобы увидеть альтернативный перевод">" Ok, I got it's position, but how can I receive nearest real vertices v3 and v4? I hope, there is a method with only one query. Thanks.<br>

</span></span><div class="yiv246961797gmail_quote">
</div><br>
</div><br>-----Inline Attachment Follows-----<br><br><div class="plainMail">_______________________________________________<br>postgis-users mailing list<br><a ymailto="mailto:postgis-users@postgis.refractions.net" href="/mc/compose?to=postgis-users@postgis.refractions.net">postgis-users@postgis.refractions.net</a><br><a href="http://postgis.refractions.net/mailman/listinfo/postgis-users" target="_blank">http://postgis.refractions.net/mailman/listinfo/postgis-users</a><br></div></blockquote></td></tr></table>