[postgis-users] st_closespoint weridness

Martin Davis mtnclimb at telus.net
Fri Oct 5 12:59:11 PDT 2012


If the point is inside the polygon, the distance between them is 0. 
Can't get closer than that!

You may want to try ST_ClosestPoint(ST_Boundary(poly), point)

On 10/5/2012 12:10 PM, Dave Potts wrote:
> just tried a
>
> select st_closestpoint(poly,point) and got the result point
>
> The point is within a the closed polygon poly, the version is postgis 2.0
> is there any sane reason why this behave in this manner.  I had expected
> to the value of the x/y coordinate pair from the polylgon that is nearest
> to point, not the value of point!
>
> Any suggestions as what I might be doing wrong?  or an suggestions for a
> better way of doing this?
>
> regards
>
>
> Dave.
>




More information about the postgis-users mailing list