[postgis-users] Understanding distance calculation

Dmitri Maximovich maxim at md.pp.ru
Mon Apr 30 09:32:23 PDT 2007


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



More information about the postgis-users mailing list