[postgis-users] Distance between an edge and a point

Paul Ramsey pramsey at opengeo.org
Sun May 3 13:26:09 PDT 2009


ST_Distance() will do the trick just fine. If your data is in
geographics, then the ST_Distance_Sphere() below will work instead.

P

On Sun, May 3, 2009 at 10:57 AM, Stephen Woodbridge
<woodbri at swoodbridge.com> wrote:
> Supunmali Ahangama wrote:
>>
>> I need to find the distance (perpendicular distance) between an edge and a
>> point. Please suggest me a function in PostGIS. Can I use distance
>> function?
>
>
> select ST_distance_sphere(ST_line_interpolate_point(linestring,
> ST_line_locate_point(LineString, Point), Point);
>
> where you have to supply linstring and Point in the above.
>
> -Steve W
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>



More information about the postgis-users mailing list