distance() method output

2 views
Skip to first unread message

Adrián Ribao

unread,
Sep 11, 2009, 12:23:39 PM9/11/09
to geodjango
Hello,

I need to calculate the distance between 2 points. Both of them are
using srid 4326. They are:
pnt1 = (-4.7351074210249688, 41.6400783785366)
and
pnt2 = (-4.2619119999999997, 43.379455)

pnt1.distance(pnt2) is 1.8025939470031596

what is this number? The distance should be 220.339Km and I don't
understand what 1.8025939... means.

How can I convert that number to km?

Thank you!

Guillaume Sueur

unread,
Sep 11, 2009, 12:32:22 PM9/11/09
to geod...@googlegroups.com
Hi Adrian,

As you are using geographic coordinates (degrees...), the output is in
the same units.
To perform a proper distance computation, you should project your data
first. Then you will be able to get a distance in metric system.

Regards,

Guillaume


Adrián Ribao a écrit :
Reply all
Reply to author
Forward
0 new messages