hi

take a look at ST_Shortestline and ST_closestpoint if you have version 1.5 of 
postgis. 
they will do what you want directly on the polygon.
HTH
Nicklas

2010-09-07 David Potts  wrote:


>I have a series of x/y values that represent towns and a coastline that
>that is encoded as a Polygon.
>
>I want to return the nearest point on the polygon to a town.  I have seen
>the item
>http://www.bostongis.com/PrinterFriendly.aspx?content_name=postgis_nearest_neighbor_generic
>
>Which seems to be fine if you both objects that your are searching  are
>point data or have a centroid of some type.
>
>What is the best solution, turn my coastal outline polygon in to a series
>of x/y values and use the solution from postgis_nearest_neighbor_generic,
>or is there some better way?
>
>regards
>
>
>Dave.
>
>-- 
>Any views expressed in this message are those of the individual sender,
>except where the sender specifically states them to be the views of the
>Pinan Software
>
>
>_______________________________________________
>postgis-users mailing list
>[email protected]
>http://postgis.refractions.net/mailman/listinfo/postgis-users
>
>
_______________________________________________
postgis-users mailing list
[email protected]
http://postgis.refractions.net/mailman/listinfo/postgis-users

Reply via email to