[postgis-users] Distance from point inside polygon to closest edge of the polygon

Chris Story kc5hhq at gmail.com
Mon Jul 30 18:43:34 PDT 2007

    I am attempting to determine the distance from a point inside a polygon
to the edge of the polygon. How can I achieve this? I am currently using the
following SQL statement to determine the distance from a point to other
polygons in my database:

select gid,
'POINT(-81.0571731786471 28.0183613937886)', 4326
))),transform(GeomFromText( 'POINT(-81.0571731786471 28.0183613937886)',
4326 ),utmzone(GeomFromText( 'POINT(-81.0571731786471 28.0183613937886)',
4326 ))))
from "S_FIRM_PAN" where distance(transform(the_geom,utmzone(GeomFromText(
'POINT(-81.0571731786471 28.0183613937886)', 4326 ))),
transform(GeomFromText( 'POINT(-81.0571731786471 28.0183613937886 )', 4326
),utmzone(GeomFromText( 'POINT(-81.0571731786471 28.0183613937886 )', 4326

I have tried doing a distance(box2d(the_geom), GeomFromText( 'POINT(-
81.0571731786471 28.0183613937886)', 4326 ) but it doesn't seem to be
working. Any takers?

Thank you,
Chris Story
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070730/f8bc849e/attachment.html>

More information about the postgis-users mailing list