This query from http://postgis.refractions.net/pipermail/postgis-users/2009-April/023265.html should give you an idea of how to do this.
The radius is an arbitrary value to avoid a full table scan. If you already know which feature is closest & just want the closest vertex from that feature, add a where clause to include just that feature. HTH Brent Wood > select * from vertices_tmp where > st_expand(setsrid(makepoint(x,y),4326),radius) && the_geom > order by distance(setsrid(makepoint(x,y),4326),the_geom) asc > limit 1; --- On Sun, 5/22/11, Александр Дымчишин <dymchis...@gmail.com> wrote: From: Александр Дымчишин <dymchis...@gmail.com> 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. To: postgis-users@postgis.refractions.net Date: Sunday, May 22, 2011, 8:35 AM I'm trying to solve the transport problem and make the visualization using Geotools. In attached pic that is what I mean. My car is between V3 and V4. Its position can I get with a query like "SELECT ST_Line_Interpolate_Point(linestring1, 0.6);" 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. -----Inline Attachment Follows----- _______________________________________________ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users
_______________________________________________ postgis-users mailing list postgis-users@postgis.refractions.net http://postgis.refractions.net/mailman/listinfo/postgis-users