[英]How can I get distance between two points on Earth from PostGIS?
I'm getting an unexpected value from a PostGIS distance query, and I'm not sure why. 我从PostGIS距离查询中得到了一个意外的值,我不知道为什么。 I'm trying to find the distance between two points on Earth.
我想找到地球上两点之间的距离。
SELECT ST_Distance(
ST_Point(50.7678,6.091499)::geography,
ST_Point(52.525592,13.369545)::geography
) as distance;
... returns 827757.672533206
, or about 827.7km. ...返回
827757.672533206
,或大约827.7km。
However, if I calculate this distance with an open source library I'm using, or using any one of several online calculators, I get 538.6km. 但是,如果我用我正在使用的开源库计算这个距离,或者使用几个在线计算器中的任何一个,我得到538.6km。 Something is obviously amiss.
有些东西显然不对劲。
What am I doing wrong? 我究竟做错了什么?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.