Supunmali Ahangama wrote:
Please suggest me with the POSTGIS/pgrouting function to identify the nearest
point from set of points (vertices in a graph) to a particular point
(outside the graph)?

You typically want to search within some radius so you do not have to do a full table scan.

select * from vertices_tmp where st_expand(setsrid(makepoint(x,y),4326)) && the_geom order by distance(setsrid(makepoint(x,y),4326),the_geom) asc limit 1;

Should do what you want.

-Steve
_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to