I have got the point and the polygon (or line). I have to find the closest coordinate (it can be the "virtual" point on edge) from polygon due to the point.
Do you know how to find out this coordinate?
This should work http://postgis.net/docs/ST_ClosestPoint.html
ST_ClosestPoint — Returns the 2-dimensional point on g1 that is closest to g2. This is the first point of the shortest line.