【发布时间】:2016-06-11 20:48:25
【问题描述】:
SELECT t.coords, t2.coords,
ST_Distance(ST_GeogFromText('SRID=4326;POINT(-115.83225 44.18711)'), ST_GeogFromText('SRID=4326;POINT(-105.83225 54.18711)')) AS d1,
ST_Distance(ST_Point(t.coords[2], t.coords[1]), ST_Point(t2.coords[2], t2.coords[1])) AS d2
FROM locations
INNER JOIN locations t2 ON t2.id = 1
WHERE t.id = 2;
t.coords = "{44.18711,-115.83225}" 和 t2.coords = "{54.18711,-105.83225}"
d1 返回为 1326899.86792105,d2 返回为 14.142135623731。
这是为什么呢?谢谢!
【问题讨论】:
标签: postgis