[postgis-users] Understanding distance calculation
David William Bitner
david.bitner at gmail.com
Mon Apr 30 09:49:26 PDT 2007
Try reversing your coordinate pairs. It should be X Y, not Y X.
On 4/30/07, Dmitri Maximovich <maxim at md.pp.ru> wrote:
>
> Hi,
>
> Just started with PostGIS and have a (possibly naive) question about
> calculating distance between two locations on the Earth surface.
>
> Say I have two points with GPS coordinates: (44.397854 -79.5505) and
> (44.37887 -79.688644). When I calculate distance between them in Google
> map or Mappoint or any other tool I'm getting around 11.2 km, e.g.:
>
>
> http://boulter.com/gps/distance/?from=44.397854+-79.5505&to=44.37887+-79.688644&units=k
>
> When I'm trying to do the same in PostgreSql (8.0.12):
>
> select distance_spheroid(
> GeomFromText('POINT(44.397854 -79.5505)', 4326),
> GeomFromText('POINT(44.37887 -79.688644)', 4326),
> 'SPHEROID["WGS_1984",6378137,298.257223563]');
>
> 15429.5199451789
>
> Should I interpret the result as 15.4 km? Obviously I'm doing something
> wrong here. Any hint would be greatly appreciated. Thanks.
>
> --
> Sincerely,
> Dmitri Maximovich
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
>
--
************************************
David William Bitner
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20070430/9722b302/attachment.html>
More information about the postgis-users
mailing list